-
-
Notifications
You must be signed in to change notification settings - Fork 746
Conversation
@CleanCut I'd recommend scaling down the PR template, at least the part about |
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.
Good direction. Fix a couple things at it's good to go.
.github/workflows/ci.yml
Outdated
with: | ||
command: fmt | ||
args: --all -- --check | ||
- run: cargo fmt |
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.
--all
is a now-deprecated synonym for --workspace
. Without one of these this command will only run on only the amethyst
crate and none of the other crates in the workspace.
-- --check
makes the command fail if it has to format something.
- run: cargo fmt | |
- run: cargo fmt --workspace -- --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.
Cargo fmt actually never made the switch to --workspace
and has to use --all
.
There is an old issue talking about it on their repo.
Edit: Found the issue.
--all
has a different function/meaning here
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, --workspace
argument isn't valid with cargo fmt
, added --all -- --check
.
6fcda3a
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.
Yikes! Sorry for the misinformation.
.github/workflows/ci.yml
Outdated
with: | ||
command: clippy | ||
args: --features=${{matrix.FEATURES}} | ||
- run: cargo clippy --features=${{matrix.FEATURES}} |
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.
Aha! You've discovered another bug. We were only running clippy on the root crate. We can't make it fail yet, though, because we haven't taken care of the warnings.
- run: cargo clippy --features=${{matrix.FEATURES}} | |
- run: cargo clippy --features=${{matrix.FEATURES}} --workspace |
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, added --workspace
in 6fcda3a
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.
Surprisingly, clippy hasn't detected any new issues for the rest of the codebase. I guess that Ran cargo clippy
chebox in PR template did the thing?
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.
I won't complain if the clippy issues are all fixed! If that is the case, let's make clippy fail if it finds anything.
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.
@CleanCut
Well, actually clippy does detect issues, but only at warning level and it doesn't fail ci, see this line in checks log
Would you merge this if I add these to to global ci env vars we have in our project?
RUSTFLAGS: "--deny warnings -Cdebuginfo=0" // Disabling debug info should speed up ci?
RUSTDOCFLAGS: "--deny warnings"
@Veetaha I agree. I added it to the list in #2407. In addition, in the future I would like as much of each CI step as possible to be encapsulated in standalone scripts, and then link from the PR template to instructions about how to use them locally to have a faster feedback loop (that could include scripts for installing pre-commit hooks, etc.). So rather than having |
Btw, @CleanCut why not running |
@Veetaha I would be fine running |
Sure, though clipply is quite caveat-y. I guess if there are some |
🤷♂️ If clippy gives different results on different platforms, then I withdraw it from consideration. 😄 |
I think @Veetaha is correct here. Clippy has to compile the code it is working on, so platform (or feature) dependent code might not get lints unless run on that platform. Fmt works on the raw source files and should be able to check everything no matter the OS. As far as I'm aware. |
bors r+ |
2450: Move cargo fmt checks and some other jobs to stable, ubuntu-latest r=CleanCut a=Veetaha ## Description See #2443 (comment) ## Modifications - Now a bunch of jobs that were previously selected to be run on `macos` switched to `ubuntu-latest`, cargo fmt check is one of them ## PR Checklist By placing an x in the boxes I certify that I have: - [ ] Added unit tests for new code added in this PR. - [x] Acknowledged that by making this pull request I release this code under an MIT/Apache 2.0 dual licensing scheme. - [ ] Added a changelog entry if this will impact users, or modified more than 5 lines of Rust that wasn't a doc comment. - [ ] Updated the content of the book if this PR would make the book outdated. If this modified or created any rs files: - [ ] Ran `cargo +stable fmt --all` - [ ] Ran `cargo clippy --workspace --features "empty"` (may require `cargo clean` before) - [ ] Ran `cargo build --features "empty"` - [ ] Ran `cargo test --workspace --features "empty"` Co-authored-by: Veetaha <veetaha2@gmail.com>
2450: Move cargo fmt checks and some other jobs to stable, ubuntu-latest r=Blisto91 a=Veetaha ## Description See #2443 (comment) ## Modifications - Now a bunch of jobs that were previously selected to be run on `macos` switched to `ubuntu-latest`, cargo fmt check is one of them ## PR Checklist By placing an x in the boxes I certify that I have: - [ ] Added unit tests for new code added in this PR. - [x] Acknowledged that by making this pull request I release this code under an MIT/Apache 2.0 dual licensing scheme. - [ ] Added a changelog entry if this will impact users, or modified more than 5 lines of Rust that wasn't a doc comment. - [ ] Updated the content of the book if this PR would make the book outdated. If this modified or created any rs files: - [ ] Ran `cargo +stable fmt --all` - [ ] Ran `cargo clippy --workspace --features "empty"` (may require `cargo clean` before) - [ ] Ran `cargo build --features "empty"` - [ ] Ran `cargo test --workspace --features "empty"` Co-authored-by: Veetaha <veetaha2@gmail.com>
Description
Simplified the config by removing actions-rs/cargo@v1
See the uses cases described in its repo.
Instead, we get less dependencies for our CI and less code
PR Checklist
By placing an x in the boxes I certify that I have:
If this modified or created any rs files:
cargo +stable fmt --all
cargo clippy --all --features "empty"
(may requirecargo clean
before)cargo build --features "empty"
cargo test --all --features "empty"