-
Notifications
You must be signed in to change notification settings - Fork 2
chore: Add workflow for running tests/lints/format checks on CI #49
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
base: master
Are you sure you want to change the base?
Conversation
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: dsherret/rust-toolchain-file@v1 | ||
| - run: cargo fmt --all -- --check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem with formatting is that Eldar used a custom styleguide for this repo, allowing 2 empty lines between the blocks. However, the blank_lines_upper_bound option in rustfmt is still unstable. So applying the formatting at the moment will try to remove extra empty lines in all of the files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we consider unifying the style-guides on the org level or at least standardizing style-guide for the repo so that it can be enforced? Otherwise either no style guide is followed, or it becomes tedious to battle with the tools, that apply default fmt rules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually we follow the default style-guide in the company. Only this repo has its own one which, unfortunately, can't be enforced at the moment. Actually, maybe enabling unstable features for rustfmt alone is not a bad solution 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it could be done just on the rustfmt level.
But are there any reasons not to switch to the default org-wide style-guide for this repo?
If you are worrying about tools like git-blame - it's easily solved with:
git config blame.ignoreRevsFile .git-blame-ignore-revs
and .git-blame-ignore-revs file that includes commit refs that did massive reformatting.
What is this PR about?
PR adds workflow with jobs for running clippy, unit tests and format checks. The list of checks for clippy and default fmt rules are left as is to open the discussion rather then necessarily advocate for the particular rules or style settings.