diff --git a/.cargo/config.toml b/.cargo/config.toml index 7f7e28a8b8..feaf5fec86 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,6 +1,7 @@ [alias] stacks-node = "run --package stacks-node --" fmt-stacks = "fmt -- --config group_imports=StdExternalCrate,imports_granularity=Module" +clippy-stacks = "clippy -p libstackerdb -p stacks-signer -p pox-locking -p clarity -p libsigner -p stacks-common --no-deps --tests --all-features -- -D warnings" # Uncomment to improve performance slightly, at the cost of portability # * Note that native binaries may not run on CPUs that are different from the build machine diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 1ba4825527..2279d42c88 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -34,7 +34,4 @@ jobs: components: clippy - name: Clippy id: clippy - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: -p libstackerdb -p stacks-signer -p pox-locking -p clarity -p libsigner -p stacks-common --no-deps --tests --all-features -- -D warnings \ No newline at end of file + run: cargo clippy-stacks \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b8c63abc2c..7c79fc286c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -387,6 +387,18 @@ You can automatically reformat your commit via: cargo fmt-stacks ``` +## Clippy Warnings + +PRs will be checked against `clippy` and will _fail_ if any clippy warnings are generated. +Unfortunately, not all existing clippy warnings have been addressed throughout stacks-core, so arguments must be passed via the command line. +Therefore, we handle `clippy` configurations using a Cargo alias: `cargo clippy-stacks` + +You can check what warnings need to be addressed locally via: + +```bash +cargo clippy-stacks +``` + ## Comments Comments are very important for the readability and correctness of the codebase. The purpose of comments is: diff --git a/clarity/src/vm/ast/parser/v2/mod.rs b/clarity/src/vm/ast/parser/v2/mod.rs index d6d1500e54..dd5a900364 100644 --- a/clarity/src/vm/ast/parser/v2/mod.rs +++ b/clarity/src/vm/ast/parser/v2/mod.rs @@ -1121,9 +1121,7 @@ mod tests { use super::*; use crate::vm::diagnostic::Level; use crate::vm::representations::PreSymbolicExpressionType; - use crate::vm::types::{ - ASCIIData, CharType, PrincipalData, SequenceData, StandardPrincipalData, UTF8Data, - }; + use crate::vm::types::{ASCIIData, CharType, PrincipalData, SequenceData}; #[test] fn test_parse_int() {