Skip to content

Add a script to automatically rustfmt all required files #3226

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

Merged
merged 2 commits into from
Aug 7, 2024

Conversation

TheBlueMatt
Copy link
Collaborator

As we now require rustfmt pass on a subset of our files, its helpful to have a script which will automatically format any required files so that contributors don't need to think too hard about it.

Copy link

codecov bot commented Aug 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.07%. Comparing base (c7419b4) to head (4c650b9).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3226      +/-   ##
==========================================
+ Coverage   89.74%   90.07%   +0.32%     
==========================================
  Files         122      122              
  Lines      101875   103449    +1574     
  Branches   101875   103449    +1574     
==========================================
+ Hits        91429    93180    +1751     
+ Misses       7761     7642     -119     
+ Partials     2685     2627      -58     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

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

LGTM.

I'm thinking it might be good to add a .githook directory to improve the development setup.

However, I am not sure if there has been any previous discussion regarding githooks that I am unaware of, so sorry if this review comment is redundant.

As we now require `rustfmt` pass on a subset of our files, its
helpful to have a script which will automatically format any
required files so that contributors don't need to think too hard
about it.
@TheBlueMatt TheBlueMatt force-pushed the 2024-08-rustfmt-contrib branch from cb952da to 0079ca8 Compare August 5, 2024 17:57
Copy link
Contributor

@tcharding tcharding left a comment

Choose a reason for hiding this comment

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

ACK cb952da

@tcharding
Copy link
Contributor

Note that running the script produces a bunch of changes.

@tcharding
Copy link
Contributor

And thanks!

@TheBlueMatt
Copy link
Collaborator Author

Note that running the script produces a bunch of changes.

You mean on latest git? It shouldn't.....

@tcharding
Copy link
Contributor

Ah, the sort order is the problem. If you add this it fixes it (need to create the rustfmt_exclude_files again also).

# Sort order is effected by locale. See `man sort`.
# > Set LC_ALL=C to get the traditional sort order that uses native byte values.
export LC_ALL=C

@TheBlueMatt
Copy link
Collaborator Author

Ah, oops, duh, thanks.

#!/bin/bash
set -eo pipefail

export LC_ALL=C
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Could have copied the comment to annotate why we need this. Any case, no real blocker.

@tnull tnull merged commit 0d2fe67 into lightningdevkit:main Aug 7, 2024
18 of 21 checks passed
@tcharding
Copy link
Contributor

Thanks for doing this one @TheBlueMatt, I did #3231 using it :)

@TheBlueMatt
Copy link
Collaborator Author

Thanks for complaining about it - it was an obvious oversight we should have had :)

@tcharding
Copy link
Contributor

You welcome! Complaining is my specialty :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants