- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
🚨 Setup CI to run linting using cargo clippy (#22)
* 👷 Setup CI to run linting using cargo clippy Run `cargo clippy --all-targets --all-features` on Continuous Integration on every Pull Request and push to main. Adapted from https://doc.rust-lang.org/stable/clippy/continuous_integration/github_actions.html * 🚨 Fix error: useless conversion to the same type * ✏️ Fix typo with missing backtick * 🚨 Rename PyCogReader's `to_numpy` to `as_numpy` Fixes `error: methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference`. Xref https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention * 🚨 Fix needless_lifetimes Xref https://rust-lang.github.io/rust-clippy/stable/index.html#/needless_lifetimes * 🚨 Allow clippy::type_complexity on xy_coords Silence `error: very complex type used. Consider factoring parts into `type` definitions`. Xref https://rust-lang.github.io/rust-clippy/stable/index.html#/type_complexity * 🚚 More to_numpy to as_numpy renames Missed a few more method renames of `to_numpy` to `as_numpy` in commit ef4cc71.
Showing
5 changed files
with
43 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Run linters | ||
# | ||
# Lint Rust code using cargo clippy. Apply static analysis rules to catch common | ||
# mistakes and improves code style. | ||
|
||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
branches: ["main"] | ||
|
||
# Make sure CI fails on all warnings, including Clippy lints | ||
env: | ||
CARGO_TERM_COLOR: always | ||
RUSTFLAGS: "-Dwarnings" | ||
|
||
jobs: | ||
clippy_check: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run Clippy | ||
run: cargo clippy --all-targets --all-features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters