Skip to content

Text file, newlines at end of files - #9804

Merged
mergify[bot] merged 12 commits into
haskell:masterfrom
cabalism:script/eol-eof-conformance
Mar 18, 2024
Merged

mergify[bot] merged 12 commits into
haskell:masterfrom
cabalism:script/eol-eof-conformance

Conversation

@philderbeast

@philderbeast philderbeast commented Mar 13, 2024 •

Copy link
Copy Markdown
Collaborator

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.

@ffaf1

ffaf1 commented Mar 13, 2024

Copy link
Copy Markdown
Collaborator

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

@philderbeast

Copy link
Copy Markdown
Collaborator Author

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

@philderbeast
philderbeast force-pushed the script/eol-eof-conformance branch from bc51c4f to d5ed8f1 Compare March 14, 2024 14:51
@philderbeast
philderbeast force-pushed the script/eol-eof-conformance branch 2 times, most recently from 0a0b0fe to cc2372d Compare March 14, 2024 15:43
Comment thread doc/getting-started.rst Resolved

@andreasabel andreasabel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also use https://github.com/andreasabel/fix-whitespace-action:

steps:
- uses: actions/checkout@v4
- uses: andreasabel/fix-whitespace-action@v1

This action downloads the pre-build binary of fix-whitespace and runs it, and also caches it.

@philderbeast
philderbeast force-pushed the script/eol-eof-conformance branch from 1c9385e to 9435037 Compare March 15, 2024 10:14
@philderbeast

Copy link
Copy Markdown
Collaborator Author

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

@philderbeast

Copy link
Copy Markdown
Collaborator Author

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

@ulysses4ever ulysses4ever left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of creating a separate workflow, can we add it to the quick-jobs workflow?

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

@philderbeast

Copy link
Copy Markdown
Collaborator Author

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

@ulysses4ever I checked and it shows violations.

@ulysses4ever

Copy link
Copy Markdown
Collaborator

Very cool, thanks!

@philderbeast

philderbeast commented Mar 15, 2024 •

Copy link
Copy Markdown
Collaborator Author

@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

philderbeast commented Mar 15, 2024 •

Copy link
Copy Markdown
Collaborator Author

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

@ulysses4ever

Copy link
Copy Markdown
Collaborator

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!

@philderbeast
philderbeast force-pushed the script/eol-eof-conformance branch from 9435037 to eb87ffd Compare March 16, 2024 11:33
@philderbeast

Copy link
Copy Markdown
Collaborator Author

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.

@mergify mergify Bot added the merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days label Mar 18, 2024
@mergify
mergify Bot merged commit 46e8221 into haskell:master Mar 18, 2024
@philderbeast

Copy link
Copy Markdown
Collaborator Author

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.

@Mikolaj

Mikolaj commented Mar 26, 2024

Copy link
Copy Markdown
Member

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

@andreasabel

Copy link
Copy Markdown
Member

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.)

@ffaf1

ffaf1 commented Mar 28, 2024

Copy link
Copy Markdown
Collaborator

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.

@andreasabel

Copy link
Copy Markdown
Member

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.

@geekosaur

Copy link
Copy Markdown
Collaborator

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.

@ffaf1

ffaf1 commented Mar 28, 2024

Copy link
Copy Markdown
Collaborator

This requires a new issue for visibility and discussion.

@ulysses4ever

Copy link
Copy Markdown
Collaborator

@mergify backport 3.12

@mergify

mergify Bot commented May 13, 2024 •

Copy link
Copy Markdown
Contributor

backport 3.12

✅ Backports have been created

Details

mergify Bot added a commit that referenced this pull request May 13, 2024
* Add back whitespace workflow

(cherry picked from commit 265f149)

* Whitespace conventions in contributing

(cherry picked from commit 7c9346b)

* Fix whitespace in workflows

(cherry picked from commit c31ca12)

# Conflicts:
#	.github/workflows/validate.yml

* Fix whitespace in docs

(cherry picked from commit 2ea012e)

* Fix whitespace in *.hs sources

(cherry picked from commit e420bf2)

* Add missing line at EOF for cabal-testsuite/**/*.hs

- Fix whitespace in cabal-testsuite + other tests

(cherry picked from commit e386a13)

* Fix whitespace in fourmolu configuration

(cherry picked from commit b790751)

* Configure fix-whitespace to include *.project

Needed for POSIX compliance for text files

(cherry picked from commit ed4c36a)

* Fix whitespace in *.project

(cherry picked from commit 38eb1e8)

* Ignore generated doc/buildinfo-fields-reference.rst

(cherry picked from commit b414faf)

* Reduce double space between prose words

Co-authored-by: brandon s allbery kf8nh <[email protected]>
(cherry picked from commit 834e1ed)

* Use fix-whitespace-action

(cherry picked from commit eb87ffd)

* Fix merge conflict

---------

Co-authored-by: Phil de Joux <[email protected]>
Co-authored-by: Hécate <[email protected]>
@ulysses4ever

Copy link
Copy Markdown
Collaborator

@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

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

Labels

merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days merge+no rebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

We have zero-line text files that aren't empty No more whitespace checks in non-.hs files

6 participants