Skip to content

Commit 872a1cf

Browse files
committed
Merge branch develop into chore/clippy-vec-and-iter-lints and fix commits
2 parents 6cdcd9b + 189d6ab commit 872a1cf

File tree

114 files changed

+407
-733
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+407
-733
lines changed

.cargo/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[alias]
22
stacks-node = "run --package stacks-node --"
33
fmt-stacks = "fmt -- --config group_imports=StdExternalCrate,imports_granularity=Module"
4+
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"
45

56
# Uncomment to improve performance slightly, at the cost of portability
67
# * Note that native binaries may not run on CPUs that are different from the build machine

.github/workflows/clippy.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,4 @@ jobs:
3434
components: clippy
3535
- name: Clippy
3636
id: clippy
37-
uses: actions-rs/clippy-check@v1
38-
with:
39-
token: ${{ secrets.GITHUB_TOKEN }}
40-
args: -p libstackerdb -p stacks-signer -p pox-locking -p clarity -p libsigner -p stacks-common --no-deps --tests --all-features -- -D warnings
37+
run: cargo clippy-stacks

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
1313
cases: when a bitcoin block is produced before the previous bitcoin block's Stacks tenure started.
1414
Previously, the miner had difficulty restarting their missed tenure and extending into the new
1515
bitcoin block, leading to 1-2 bitcoin blocks of missed Stacks block production.
16+
- The event dispatcher now includes `consensus_hash` in the `/new_block` and `/new_burn_block` payloads. ([#5677](https://github.com/stacks-network/stacks-core/pull/5677))
1617

1718
## Changed
1819

CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,18 @@ You can automatically reformat your commit via:
387387
cargo fmt-stacks
388388
```
389389

390+
## Clippy Warnings
391+
392+
PRs will be checked against `clippy` and will _fail_ if any clippy warnings are generated.
393+
Unfortunately, not all existing clippy warnings have been addressed throughout stacks-core, so arguments must be passed via the command line.
394+
Therefore, we handle `clippy` configurations using a Cargo alias: `cargo clippy-stacks`
395+
396+
You can check what warnings need to be addressed locally via:
397+
398+
```bash
399+
cargo clippy-stacks
400+
```
401+
390402
## Comments
391403

392404
Comments are very important for the readability and correctness of the codebase. The purpose of comments is:

clarity/src/libclarity.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,19 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17-
#![allow(unused_imports)]
1817
#![allow(dead_code)]
1918
#![allow(non_camel_case_types)]
2019
#![allow(non_snake_case)]
2120
#![allow(non_upper_case_globals)]
2221
#![cfg_attr(test, allow(unused_variables, unused_assignments))]
2322

23+
#[allow(unused_imports)]
2424
#[macro_use(o, slog_log, slog_trace, slog_debug, slog_info, slog_warn, slog_error)]
2525
extern crate slog;
2626

2727
#[macro_use]
2828
extern crate serde_derive;
2929

30-
#[macro_use]
3130
extern crate serde_json;
3231

3332
#[cfg(any(test, feature = "testing"))]

clarity/src/vm/analysis/analysis_db.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ use std::collections::{BTreeMap, BTreeSet};
1818

1919
use stacks_common::types::StacksEpochId;
2020

21-
use crate::vm::analysis::errors::{CheckError, CheckErrors, CheckResult};
21+
use crate::vm::analysis::errors::{CheckErrors, CheckResult};
2222
use crate::vm::analysis::type_checker::ContractAnalysis;
2323
use crate::vm::database::{
2424
ClarityBackingStore, ClarityDeserializable, ClaritySerializable, RollbackWrapper,
2525
};
2626
use crate::vm::representations::ClarityName;
2727
use crate::vm::types::signatures::FunctionSignature;
28-
use crate::vm::types::{FunctionType, QualifiedContractIdentifier, TraitIdentifier, TypeSignature};
28+
use crate::vm::types::{FunctionType, QualifiedContractIdentifier, TraitIdentifier};
2929
use crate::vm::ClarityVersion;
3030

3131
pub struct AnalysisDatabase<'a> {

clarity/src/vm/analysis/arithmetic_checker/mod.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,16 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17-
use hashbrown::HashMap;
18-
1917
pub use super::errors::{
2018
check_argument_count, check_arguments_at_least, CheckError, CheckErrors, CheckResult,
2119
};
22-
use super::AnalysisDatabase;
23-
use crate::vm::analysis::types::{AnalysisPass, ContractAnalysis};
20+
use crate::vm::analysis::types::ContractAnalysis;
2421
use crate::vm::functions::define::{DefineFunctions, DefineFunctionsParsed};
25-
use crate::vm::functions::{tuples, NativeFunctions};
22+
use crate::vm::functions::NativeFunctions;
2623
use crate::vm::representations::SymbolicExpressionType::{
2724
Atom, AtomValue, Field, List, LiteralValue, TraitReference,
2825
};
29-
use crate::vm::representations::{ClarityName, SymbolicExpression, SymbolicExpressionType};
30-
use crate::vm::types::{
31-
parse_name_type_pairs, PrincipalData, TupleTypeSignature, TypeSignature, Value,
32-
};
26+
use crate::vm::representations::{ClarityName, SymbolicExpression};
3327
use crate::vm::variables::NativeVariables;
3428
use crate::vm::ClarityVersion;
3529

clarity/src/vm/analysis/read_only_checker/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,12 @@ pub use super::errors::{
2323
use super::AnalysisDatabase;
2424
use crate::vm::analysis::types::{AnalysisPass, ContractAnalysis};
2525
use crate::vm::functions::define::DefineFunctionsParsed;
26-
use crate::vm::functions::{tuples, NativeFunctions};
26+
use crate::vm::functions::NativeFunctions;
2727
use crate::vm::representations::SymbolicExpressionType::{
2828
Atom, AtomValue, Field, List, LiteralValue, TraitReference,
2929
};
3030
use crate::vm::representations::{ClarityName, SymbolicExpression, SymbolicExpressionType};
31-
use crate::vm::types::{
32-
parse_name_type_pairs, PrincipalData, TupleTypeSignature, TypeSignature, Value,
33-
};
34-
use crate::vm::variables::NativeVariables;
31+
use crate::vm::types::{PrincipalData, Value};
3532
use crate::vm::ClarityVersion;
3633

3734
#[cfg(test)]

clarity/src/vm/analysis/read_only_checker/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use rstest_reuse::{self, *};
2121
use stacks_common::types::StacksEpochId;
2222

2323
use crate::vm::analysis::type_checker::v2_1::tests::mem_type_check;
24-
use crate::vm::analysis::{type_check, CheckError, CheckErrors};
24+
use crate::vm::analysis::{type_check, CheckErrors};
2525
use crate::vm::ast::parse;
2626
use crate::vm::database::MemoryBackingStore;
2727
use crate::vm::tests::test_clarity_versions;

clarity/src/vm/analysis/tests/mod.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,8 @@
1616

1717
use stacks_common::types::StacksEpochId;
1818

19-
use crate::vm::analysis::errors::CheckErrors;
19+
use crate::vm::analysis::mem_type_check as mem_run_analysis;
2020
use crate::vm::analysis::type_checker::v2_1::tests::mem_type_check;
21-
use crate::vm::analysis::{
22-
mem_type_check as mem_run_analysis, type_check, AnalysisDatabase, ContractAnalysis,
23-
};
24-
use crate::vm::ast::parse;
2521
use crate::vm::ClarityVersion;
2622

2723
#[test]

0 commit comments

Comments
 (0)