Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project.toml formatting test not sensible in julia pre-1.7 #208

Closed
lgoettgens opened this issue Oct 13, 2023 · 10 comments · Fixed by #209
Closed

Project.toml formatting test not sensible in julia pre-1.7 #208

lgoettgens opened this issue Oct 13, 2023 · 10 comments · Fixed by #209
Labels
Milestone

Comments

@lgoettgens
Copy link
Collaborator

Pkg.jl my alter a Project.toml file when instantiating before julia 1.7 (cf. JuliaLang/Pkg.jl#3481 (comment)).
Thus, the current test is basically a no-op returning pass on julia 1.6 and before (in CI), as the Project.toml gets formatted when instantiating the project and thus everything is already formatted when Aqua inspects it.

If a package uses package extensions, this is even worse, as the automatic formatting on julia 1.6 and before is incompatible with the one required by the Aqua test. Therefore, this test always fails in these cases.

For the previous discussion, please refer to #105 (comment) and the comments below it.

@fingolfin
Copy link
Collaborator

In my opinion, the whole Project.toml formatting test is not sensible, period. In any Julia version. At least not in a project about "quality assurance" -- the order in which things appear in Project.toml are not indicative for quality. There is only one reason to have things ordered, and that is to minimize diffs when using Pkg to add entries to it.

As such, my preferred "fix" for this "problem" would be to remove the Project.toml formatting test completely.

@lgoettgens
Copy link
Collaborator Author

@gdalle @fingolfin Let's please discuss #206, #209, and #210 here until we decide on one of them to keep the discussion in one place

@lgoettgens
Copy link
Collaborator Author

I think the change of default order from julia 1.6 to 1.7 is a good indicator that this test is actually needed. Imagine having two people working on a project together but with different julia versions that enforce different formatting. In this case, even though there is no "real" change to the Project.toml, even no-ops (as add and then rm a dep) bring new large diffs. The Aqua test then decides on one of the two formatting that should be used consistently.

Thus, my preferred solution fix would be to exclude this test from all julia/Pkg.jl versions that modify the Project.toml when running resolve or instantiate (see #210).

@gdalle
Copy link
Contributor

gdalle commented Oct 15, 2023

Sounds good to me

@lgoettgens lgoettgens added this to the 0.8 milestone Oct 16, 2023
@devmotion
Copy link

I just ran into this issue again in a private project on Julia 1.9. The setup is a bit special (exported Preferences.jl preferences in the Project.toml - maybe the issue was caused by JuliaPackaging/Preferences.jl#52?) but nevertheless this means I'll just have to disable this check in yet another repo. IMO this Aqua test should just be removed completely since apparently not even libraries such as Pkg and Preferences can agree on a specific order.

@gdalle
Copy link
Contributor

gdalle commented Oct 18, 2023

Maybe instead of the other one could just check the presence of various components? And their relations? As in, if there's a target section there must be extras, etc

@lgoettgens
Copy link
Collaborator Author

Ok, so the existence of JuliaPackaging/Preferences.jl#52 (and possibly many similar things in other packages) is a dealbreaker for me. I would thus proceed with #209.
If we want to test a subset of it (alphabetical order in each category, presence/relation of components, etc.), I would suggest to add that as a default-disabled test later in the 0.8.x cycle. I would declare it as "subject to change" so we can gradually add features, and release it as default-enabled in 0.9.

@fingolfin @gdalle Objections?

@gdalle
Copy link
Contributor

gdalle commented Oct 18, 2023

I agree that it seems like it does more harm than good these days

@fingolfin fingolfin linked a pull request Oct 24, 2023 that will close this issue
@fingolfin
Copy link
Collaborator

Yes I agree (unsurprising since #209 is mine). And I would be fully in support for a structural test that reports things like missing compat entries etc., as suggested by @gdalle .

@lgoettgens
Copy link
Collaborator Author

lgoettgens commented Oct 24, 2023

Yes I agree (unsurprising since #209 is mine). And I would be fully in support for a structural test that reports things like missing compat entries etc., as suggested by @gdalle .

Just FYI, missing compat entries are already checked by test_deps_compat. But there is other stuff to check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment