haskell / cabal

Official upstream development repository for Cabal and cabal-install
https://haskell.org/cabal
Other
1.57k stars 676 forks source link

Text file, newlines at end of files (backport #9804) #10007

Closed mergify[bot] closed 2 weeks ago

mergify[bot] commented 2 weeks ago

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.


This is an automatic backport of pull request #9804 done by Mergify.

mergify[bot] commented 2 weeks ago

Cherry-pick of c31ca12e97e5ddbe0808d05cef94bbcf72ed570a has failed:

On branch mergify/bp/3.12/pr-9804
Your branch is ahead of 'origin/3.12' by 2 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit c31ca12e9.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
    modified:   .github/workflows/bootstrap.skip.yml
    modified:   .github/workflows/validate.skip.yml

Unmerged paths:
  (use "git add <file>..." to mark resolution)
    both modified:   .github/workflows/validate.yml

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Kleidukos commented 2 weeks ago

bullshit failure from fix-whitespace:

[ Violation detected ] license-list-data/exceptions-3.23.json
[ Violation detected ] license-list-data/licenses-3.23.json
ulysses4ever commented 2 weeks ago

@philderbeast we tried to backport you #9804 to the 3.12 branch but it failed on the whitespace action, as mentioned above:

[ Violation detected ] license-list-data/exceptions-3.23.json
[ Violation detected ] license-list-data/licenses-3.23.json

Here's the failing workflow: https://github.com/haskell/cabal/actions/runs/9065601825/job/24906767545

Do you have any idea why it's fine on master but fails here, on 3.12? I compared these JSON files and the fix-whitespace config to the master versions but didn't find any differences.

philderbeast commented 2 weeks ago

@ulysses4ever do you know how I can checkout this branch locally? I tried;

$ gh pr checkout 10007
fatal: couldn't find remote ref refs/heads/mergify/bp/3.12/pr-9804
failed to run git: exit status 128
philderbeast commented 2 weeks ago

Thanks for restoring the branch @ulysses4ever.

philderbeast commented 2 weeks ago

There are two choices, either exclude those two files with violations (in fix-whitespace.yaml) or accept the fixes. I prefer the later. Copying the two violating files from this PR's branch to master, I see a difference;

$ git diff
diff --git a/license-list-data/exceptions-3.23.json b/license-list-data/exceptions-3.23.json
index 774f2632e..e2ad72824 100644
--- a/license-list-data/exceptions-3.23.json
+++ b/license-list-data/exceptions-3.23.json
@@ -769,4 +769,4 @@
     }
   ],
   "releaseDate": "2024-02-08"
-}
+}
\ No newline at end of file
diff --git a/license-list-data/licenses-3.23.json b/license-list-data/licenses-3.23.json
index ab676e4ef..884a5e62d 100644
--- a/license-list-data/licenses-3.23.json
+++ b/license-list-data/licenses-3.23.json
@@ -7994,4 +7994,4 @@
     }
   ],
   "releaseDate": "2024-02-08"
-}
+}
\ No newline at end of file
ulysses4ever commented 2 weeks ago

Yes, thank you, I am accepting these in #10008. I wined a little about it here: https://github.com/haskell/cabal/pull/9818#issuecomment-2109132238