-
Notifications
You must be signed in to change notification settings - Fork 701
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
Autoformat more directories #10491
base: master
Are you sure you want to change the base?
Autoformat more directories #10491
Conversation
bold! People seem to want to scrap auto-formatting as it creates a noticeable tension with new/rare contributors. One thing to consider is the release cycle. We're about to release cabal-install-3.14.1.0, and there will be many backports, which reformatting may complicate. A better point for it may be a little while after a release. |
That's likely to feel like 3.10 after the initial fourmolu pass, though. |
FWIW I was very surprised to hear this -- I find an autoformatter that clearly fails in CI so much easier to work with as an infrequent contributor than a (usually vague) style guide that's variably enforced by individual reviewers... |
I'd really like to see this go in. I don't want have to bother formatting code by hand. |
@9999years, I can help with the CPP drudgery if that would speed things up. |
Since we turned 180 on scrapping the autoformatter (again!) and seem to be sticking with it, I'd be fine with this patch (once it's turned out of the draft state), in principle. Is it intentional that it doesn't touch the CI? CI currently does its own thing with the action, and has its own list of directories, sadly. I'd be happier if CI exercised the make-targets. But I also foresee some contributors screaming at CI if it starts checking tests, for instance... |
@ulysses4ever Definitely not intentional, good catch! |
5f18808
to
f7a7a15
Compare
f7a7a15
to
0ecda25
Compare
.github/workflows/format.yml
Outdated
Cabal-testsuite/src/**/*.hs | ||
Cabal-testsuite/main/**/*.hs | ||
Cabal-testsuite/static/**/*.hs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Case seems off here (and maybe somewhere else)? I mean Cabal-testsuite
not cabal-testsuite
, and the latter is the correct one.
It's also strange that CI missed this issue.
@alt-romes @mpickering Do you have any PRs which would conflict with this? Happy to split this PR up. |
From today's meeting: We might want to pay attention to: #9743 |
To expand on @9999years's comment above, we're particularly worried about #9743 But as discussed at the meeting, the PR branch could be reformatted accordingly, and then it should hopefully not require any other effort. |
If we're worried about conflicts, we could merge #10683 early that deals with the parsing errors fourmolu encounters, then merge other major pull requests that we don't want to reformat and then merge this pull request. |
I don't think that a autoformatter should be used at all, so splitting up the PR or anything else won't help so much. I thought the consensus was to remove the formatter and it seems that a single PR has changed the course again? There will always be long-lived branches for large open-source projects which become hard to rebase, it's not a temporary problem. |
|
@mpickering The current plan is to autoformat the LTS branches to match this PR, once this PR is merged, so that backports will remain easy. Does that help ameliorate your concerns? |
@9999years No, that does not address the concern at all. The concern is that there are long-lived contributor branches for complicated features which may exists for years outside the tree before being merged. |
@mpickering you can reformat the long-lived branch any time, if the "base" branch you want to merge into was reformatted over time. And the result would be the diff we are interested in, nothing about formatting. I still don't see any problem. What am I missing? |
This seems to me to be a symptom of an issue. Big changes like that should be shipped incrementally. Large complicated features (and large complicated diffs) are essentially impossible to review and should be discouraged. Even without reformatting the codebase, regular churn means constant rewrites to adjust to the underlying architecture shifting. (See, for example, how I had to completely rewrite #9367 before it could be merged, because the way Cabal runs |
Yes, I think we certainly agree that working on a long lived patch is difficult on a large codebase. Rebasing after a period is challenging due to the churn from changes. It seems like we disagree on taking measures to help that situation by removing unnecessary formatting changes from the diff. It does seem better to be able to incrementally land patches, but my experience is that making incremental changes can be difficult in an open-source project, as there is no guarantee anyone will finish a patch. It is easily possible that things are left in an intermediate state for a long period, and maintainers don't feel like they have agency to revert partial changes. If the maintainers of cabal are in agreement that a formatter is a good idea, then it is not the place to litigate on each PR about the usage of a formatter. It was just my understanding that they had already decided to remove the formatter requirement. I know I am not the only contributor who has found the formatter gets in the way of development, so if on balance the maintainers wish to take these complaints into account but decide on balance it is worthwhile then I will respectfully disagree and direct my energy into writing productive patches. |
Yeah, I definitely agree that this is a problem to work on — I think the maintainers should feel comfortable reverting partial changes. I also think that maintainers should have more power with reverting those changes. I think two-reviews-per-PR keeps the velocity of this project much slower than it needs to be and discourages splitting up changes into multiple PRs (because getting two reviews is, in my experience, a lot harder than getting just one). |
In my experience, formatting changes don't make it significantly harder to rebase a PR. Like, yeah, they can't be resolved trivially, but usually it's pretty obvious how to adapt a rebased commit to accommodate a refactor-related change on |
sickos yes