rust-payjoin icon indicating copy to clipboard operation
rust-payjoin copied to clipboard

ci: format TOML files using taplo and enforced CI formatting

Open Cyber-Lord opened this issue 4 months ago • 5 comments

Pull Request Checklist

Please confirm the following before requesting review:

In this PR, I have used ChatGPT to research available formatting tools, compared them and identified best fit for this issue #1016 The PR aims to close #1016 by formatting and sorting the TOML files in the repository and introduced a check on CI to enforce formatting. taplo is used for this and ensured consistent whitespace, indentation, and ordering across all TOML files.

Added to the GitHub Actions workflow to run taplo format --check on pull requests and pushes to main. This will ensure future PRs don’t introduce formatting inconsistencies in TOML files.

Cyber-Lord avatar Aug 30 '25 00:08 Cyber-Lord

Pull Request Test Coverage Report for Build 17336950193

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 85.916%

Totals Coverage Status
Change from base Build 17332008623: 0.0%
Covered Lines: 8168
Relevant Lines: 9507

💛 - Coveralls

coveralls avatar Aug 30 '25 01:08 coveralls

this will probably generate conflicts for some other PRs, to help merge this with minimum friction please also split it into two commits, one to apply the formatting, which includes the precise command to run (look into bitcoin core's scripted diffs for a standard way to do this), and then the small commit to enforce. this way rebasing it can be automated to avoid conflicts (by replacing the pick abc123, the formatting commit, with an exec taplo format $( git ls-files | grep '\.toml$' ) && git commit -a -C abc123)

nothingmuch avatar Aug 30 '25 01:08 nothingmuch

There are some unintended changes caused in some rust files. I will undo then and improve the commits asap

Cyber-Lord avatar Aug 30 '25 10:08 Cyber-Lord

see https://github.com/jonatack/bitcoin-development/blob/master/scripted-diffs.md for a description, it just makes it easier to verify that large diffs do exactly what they are supposed to

the first one is not a scripted diff as it can't be recreated by just running the command, if i switch to it reset all the toml files to be as they were in the previous commit apart from the taplo.toml file that is introduced, i still can't reproduce the diff exactly since there is some reordering presumably by cargo sort

sorry to be a stickler about this but there are multiple PRs that are already open that change dependencies and therefore will conflict with this PR, to avoid blocking those PRs i prefer if we wait with merging this one, making it really a scripted diff means it's trivial to rebase this commit without having to deal with conflicts when it's time to do so

if you prefer i could do this for you and rebase it when it's time to merge this (i could also add the flake stuff)

nothingmuch avatar Aug 31 '25 18:08 nothingmuch

Sure @nothingmuch Thank you

Cyber-Lord avatar Aug 31 '25 20:08 Cyber-Lord

Couple weeks without activity on this PR. @Cyber-Lord / @nothingmuch Are you still planning on working on this?

arminsabouri avatar Nov 24 '25 16:11 arminsabouri

This PR was effectively folded into #1221... Thanks @Cyber-Lord and sorry for taking so long to merge your changes

nothingmuch avatar Dec 12 '25 17:12 nothingmuch