Skip to content

Commit

Permalink
Merge pull request #5734 from stacks-network/chore/add-clippy-stacks
Browse files Browse the repository at this point in the history
Chore/add clippy-stacks alias
  • Loading branch information
kantai authored Jan 23, 2025
2 parents bc56d9e + e1bd4dd commit 189d6ab
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
run: cargo clippy-stacks
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 1 addition & 3 deletions clarity/src/vm/ast/parser/v2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 189d6ab

Please sign in to comment.