Skip to content
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

Fail CI on failed fmt or other linting file changes #1422

Merged
merged 4 commits into from
Feb 10, 2022
Merged

Conversation

LesnyRumcajs
Copy link
Member

Summary of changes
Changes introduced in this pull request:

  • Changes the CI lint step to check for changes resulted from e.g. cargo fmt. Before they were silently discarded.

@CLAassistant
Copy link

CLAassistant commented Feb 10, 2022

CLA assistant check
All committers have signed the CLA.

@LesnyRumcajs LesnyRumcajs marked this pull request as draft February 10, 2022 12:59
@lemmih
Copy link
Contributor

lemmih commented Feb 10, 2022

Just change the lint target to run cargo fmt --all -- --check. It should not actually do any formatting.

@LesnyRumcajs
Copy link
Member Author

LesnyRumcajs commented Feb 10, 2022

Just change the lint target to run cargo fmt --all -- --check. It should not actually do any formatting.

Yes, but then anyone wanting to run the lint will have to cargo fmt --all himself - trying not to introduce breaking changes to existing contributors 😄 . Plus, any further add-ons to lint that are mutating the code will get caught for free. What do you think?

@lemmih
Copy link
Contributor

lemmih commented Feb 10, 2022

Just change the lint target to run cargo fmt --all -- --check. It should not actually do any formatting.

Yes, but then anyone wanting to run the lint will have to cargo fmt --all himself - trying not to introduce breaking changes to existing contributors smile . What do you think?

I think it is a mistake that lint modified the code in the first place. In my mind, linting should check for problems, not automatically fix them.

@LesnyRumcajs
Copy link
Member Author

Just change the lint target to run cargo fmt --all -- --check. It should not actually do any formatting.

Yes, but then anyone wanting to run the lint will have to cargo fmt --all himself - trying not to introduce breaking changes to existing contributors smile . What do you think?

I think it is a mistake that lint modified the code in the first place. In my mind, linting should check for problems, not automatically fix them.

Indeed, I was a bit surprised myself. All right, I'll do the --check, thanks for the insight.

@lemmih
Copy link
Contributor

lemmih commented Feb 10, 2022

Hopefully #1420 will soon be merged such that the audit step passes.

@LesnyRumcajs LesnyRumcajs marked this pull request as ready for review February 10, 2022 14:13
@LesnyRumcajs LesnyRumcajs merged commit f7141b4 into main Feb 10, 2022
@LesnyRumcajs LesnyRumcajs deleted the lint-check-ci branch February 10, 2022 16:49
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.

4 participants