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

Fix rustfmt, clippy issues #87

Merged
merged 4 commits into from
Nov 13, 2023
Merged

Fix rustfmt, clippy issues #87

merged 4 commits into from
Nov 13, 2023

Conversation

janaknat
Copy link
Contributor

@janaknat janaknat commented Nov 7, 2023

Also, add Github checks for rustfmt and clippy.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@janaknat janaknat force-pushed the fmt-clippy branch 2 times, most recently from b71d09e to 453035d Compare November 7, 2023 01:35
Also, add rustfmt and clippy to Github CI.
action-rs has been archived. Move to using dtolnay/rust-toolchain.
@@ -21,11 +21,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
Copy link
Contributor

Choose a reason for hiding this comment

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

Leaving this version floating means we could get spontaneous failures starting at any point not triggered by a change :/

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be locked to a version, assuming that's possible.

Comment on lines +72 to +75
- name: Run clippy
run: source ~/.nvm/nvm.sh && cargo clippy --all-targets --all-features
- name: Run rustfmt
run: source ~/.nvm/nvm.sh && cargo fmt --all -- --check
Copy link
Contributor

Choose a reason for hiding this comment

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

You shouldn't need the nvm.sh part for clippy and format runs, only for things that do a build. Do a clean and then try them without that part.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It failed without the nvm.sh. I initially tried without it and all CI jobs failed.

let status = Command::new("npm")
.arg("install")
.spawn()?
.wait()?;
if ! status.success() {
let status = Command::new("npm").arg("install").spawn()?.wait()?;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the kind of thing that's th downside to auto-formatting. This is worse formatting.

@janaknat janaknat merged commit 5b32c8b into main Nov 13, 2023
5 checks passed
@janaknat janaknat deleted the fmt-clippy branch November 16, 2023 18:04
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.

2 participants