Skip to content

Commit

Permalink
Merge pull request #357 from EnergySystemsModellingLab/precommit-disa…
Browse files Browse the repository at this point in the history
…ble-clippy-fix

`pre-commit`: Disable auto-fixing for clippy
  • Loading branch information
alexdewar authored Feb 14, 2025
2 parents eb350a5 + a880d95 commit 67ee72a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[alias]
# Automatically fix clippy warnings (where possible)
clipfix = "clippy --fix --allow-dirty --allow-staged"
2 changes: 0 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ repos:
rev: v1.0
hooks:
- id: clippy
# Warnings can be suppressed by adding "-A clippy::some_warning" to args
args: [--fix, --allow-dirty, --allow-staged, --, -D, clippy::all, -A, clippy::precedence]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
Expand Down
7 changes: 7 additions & 0 deletions docs/developer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,10 @@ pre-commit install

Thereafter, a series of checks should be run every time you commit with Git. In addition, the
`pre-commit` hooks are also run as part of the CI pipeline.

Note: you may get errors due to the [`clippy`] hook failing. In this case, you may be able to
automatically fix them by running `cargo clipfix` (which we have defined as an alias in
[`.cargo/config.toml`]).

[`clippy`]: https://doc.rust-lang.org/clippy
[`.cargo/config.toml`]: https://github.com/EnergySystemsModellingLab/MUSE_2.0/blob/main/.cargo/config.toml
1 change: 0 additions & 1 deletion src/input/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ where
}

/// Try to insert a region ID into the specified map
#[must_use]
fn try_insert_region(
entity_id: Rc<str>,
region_id: &str,
Expand Down

0 comments on commit 67ee72a

Please sign in to comment.