-
Notifications
You must be signed in to change notification settings - Fork 3
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
Enforce code style on CI with rustfmt #39
base: master
Are you sure you want to change the base?
Conversation
.travis.yml
Outdated
script: | ||
- if [[ "$TRAVIS_RUST_VERSION" == "stable" || "$TRAVIS_RUST_VERSION" == "nightly" ]]; then cargo clippy --all-targets --all-features -- -D warnings; fi | ||
- cargo fmt --all --write-mode diff |
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.
What's the difference between --write-mode diff
and --check
? rustfmt
's instructions for CI seem to prefer --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.
yup my bad. I misread something.
@0xazure - running |
No, Travis isn't set up to make and commit changes on its own, and generally we would want a person to do those tasks. It's more of a second verification step to ensure that the format is correct before PRs, etc get merged into As part of this PR you'll also need to run |
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.
Travis config looks good, though I'd like to see the rustfmt
steps applied to Linux-Beta
and Windows-Beta
as well.
Other than that, just run rustfmt
locally, fix any problems the tool reports but can't fix by itself (there shouldn't be (m)any, I hope) and commit all the changes as part of this PR.
Hey @biskit1 thanks for following up. Unfortunately I think there was a miscommunication between #39 (this pull request) and #43. To be a candidate to fix #21, #39 (this pull request) should:
Also, in light of the existence of #32, #39 could also:
but this is not completely necessary for this pull request to be accepted. You said:
but my comment in #43 was (in part):
so I'm not sure what part of my suggestion you're referring to here. I did mention that branching pull requests from other active pull requests isn't generally something we want to do, simply because it can make conflict resolution more tedious, but I didn't mean to merge all the changes back into one branch and I'm sorry if I didn't communicate that clearly. Pull requests are generally focused on adding/fixing/improving one thing; in the case of #39 (this pull request), it's implementing changes to fix #21 as I outlined above. I would really like to see a fix for #32 land as a separate pull request, unrelated to this one. #43 is a good start towards this, but should be more focused on fixing #32 specifically (that is: focus on printing the Let me know if you have any questions, and feel free to ping me over chat too! |
@0xazure Sorry for the confusion and mess 😝 I thought we didn't want to use 43 because of the fact that I had it branching off of this one. I think I also got confused by this paragraph from your review in 43:
I'm not sure why I branched 43 off of 39. I must have been thinking that it would make sense to add So to clarify, what you're saying is Considering 43 is currently branched off of this PR's branch, for the sake of simplicity can we just close 43 and I'll open a new PR to print the Sorry again for the confusion. Count on me to confuse the simplest things 🙄 |
Fixes #21
Note: I haven't done any testing as of yet- have to do some more reading about how it all works, and then will test it out later this week.