cabal icon indicating copy to clipboard operation
cabal copied to clipboard

Text file, newlines at end of files

Open philderbeast opened this issue 1 year ago • 14 comments

Fixes #9802 for *.hs and *.project files ~and adds a script taking a file glob pattern for doing this~, adding newlines at the ends of files where needed. Adds back the whitespace github workflow and uses fix-whitespace to fix non-conformance. Add a short note about this in the contributing readme.

philderbeast avatar Mar 13 '24 21:03 philderbeast

@andreasabel created whitespace.yml, let us see what he has to say.

ffaf1 avatar Mar 13 '24 22:03 ffaf1

@ulysses4ever I see you are a fix-whitespace contributor. Do you think we can get fix-whitespace and fourmolu to play nicely together?

philderbeast avatar Mar 14 '24 11:03 philderbeast

Thanks @andreasabel fix-whitespace-action is way less configuration. I reverted one of the corrections and it shows violations in the output.

philderbeast avatar Mar 15 '24 10:03 philderbeast

Label merge+no rebase is necessary when the pull request is from an organisation.

philderbeast avatar Mar 15 '24 10:03 philderbeast

I reverted one of the corrections and it shows violations in the output.

@ulysses4ever I checked and it shows violations.

philderbeast avatar Mar 15 '24 10:03 philderbeast

Very cool, thanks!

ulysses4ever avatar Mar 15 '24 10:03 ulysses4ever

@ulysses4ever, funny thing about moving it to quick jobs is that it now doesn't run nearly as quickly (the ghcup, hackage and alex stuff takes a lot longer to run)!

philderbeast avatar Mar 15 '24 10:03 philderbeast

In terms of developer feedback, putting it alongside (at the end of) quick jobs is a big degradation.

philderbeast avatar Mar 15 '24 10:03 philderbeast

Mm, good point. My intention was not having it run quickly, though, and rather I dislike proliferation of standalone workflows. But maybe it’d be good to get an actually quick feedback from this job…

We need to fix quick-jobs to only download binaries and not build anything with ghc!

ulysses4ever avatar Mar 15 '24 10:03 ulysses4ever

I do think that jobs like this one and the docs should run near instantly otherwise the wait is annoying.

philderbeast avatar Mar 15 '24 10:03 philderbeast

@ulysses4ever are you OK if I revert the last change, putting whitespace into its own workflow?

philderbeast avatar Mar 15 '24 10:03 philderbeast

Yeah, up to you, approved. Thanks!

ulysses4ever avatar Mar 15 '24 10:03 ulysses4ever

@ulysses4ever I see there is something wrong with the cache in quick jobs;

Post job cleanup. Warning: Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.

philderbeast avatar Mar 15 '24 10:03 philderbeast

Interesting... Maybe worth a new ticket with the continuous-integration label.

ulysses4ever avatar Mar 15 '24 11:03 ulysses4ever

How much squashing should I be doing with this given that the advice is:

If you push a fix of a whitespace violation, please do so in a separate commit.

philderbeast avatar Mar 16 '24 11:03 philderbeast

Sorry @Mikolaj for the lack of squashing. I asked about squashing but forgot to come back to it. Noticed when I got the cabal.head email.

philderbeast avatar Mar 25 '24 17:03 philderbeast

Ouch. With no-rebase and no manual rebase nor squash just before merging, the 12 commits are strewn artistically across other PRs from the several last days. I guess we have to get used to git art. :D

Mikolaj avatar Mar 26 '24 08:03 Mikolaj

For the sake of bisecting, a linear history is really a plus. Can't we enforce it on this repo? (On the Agda repo, I disabled merge commits.)

andreasabel avatar Mar 28 '24 06:03 andreasabel

Some contributors — and most importantly, some employers — do not fancy cabal to have write access their repos (e.g.).

At first we did some manual cherry-picking, but then we gave in and merge+no rebase was introduced.

ffaf1 avatar Mar 28 '24 06:03 ffaf1

Can mergify do the rebase by copying the contributor branch to a new branch on this repo first? Can this be set up? This might be a technical solution.

If a PR cannot be rebased then it should be rejected by default. Otherwise, we'll not get a linear history.

Contributors with write access could be encouraged to push to a branch here rather than on their own repo.

andreasabel avatar Mar 28 '24 07:03 andreasabel

Contributors with write access could be encouraged to push to a branch here rather than on their own repo.

This could be difficult if the contributor is working on an employer's tree as part of their job.

geekosaur avatar Mar 28 '24 15:03 geekosaur

This requires a new issue for visibility and discussion.

ffaf1 avatar Mar 28 '24 17:03 ffaf1

@mergify backport 3.12

ulysses4ever avatar May 13 '24 15:05 ulysses4ever

backport 3.12

✅ Backports have been created

mergify[bot] avatar May 13 '24 15:05 mergify[bot]

@philderbeast

Can you check that fix-whitespace is run with a flag that will show the actual violations?

I checked and it shows violations.

Apparently, we misunderstood each other. What I meant is that it should show not only the names of the files with whitespace issues but also the issues themselves. It could be done by the verbose: true option of the action:

https://github.com/andreasabel/fix-whitespace-action/blob/2a7678e2f1319ae6e9595acb06b8cfb46e38af23/action.yml#L17-L20

ulysses4ever avatar May 13 '24 18:05 ulysses4ever