Skip to content

Commit

Permalink
update linting configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalojoec committed Oct 24, 2024
1 parent c62c2bd commit 41b747d
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 6 deletions.
8 changes: 8 additions & 0 deletions program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,11 @@ crate-type = ["cdylib", "lib"]

[build-dependencies]
rustc_version = "0.4"

[lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = [
'cfg(target_os, values("solana"))',
'cfg(feature, values("min_specialization"))',
'cfg(RUSTC_WITH_SPECIALIZATION)',
]
2 changes: 1 addition & 1 deletion program/tests/create_lookup_table_ix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn test_create_lookup_table_idempotent() {
lookup_table_account.lamports(),
Rent::default().minimum_balance(LOOKUP_TABLE_META_SIZE)
);
let lookup_table = AddressLookupTable::deserialize(&lookup_table_account.data()).unwrap();
let lookup_table = AddressLookupTable::deserialize(lookup_table_account.data()).unwrap();
assert_eq!(lookup_table.meta.deactivation_slot, Slot::MAX);
assert_eq!(lookup_table.meta.authority, Some(authority));
assert_eq!(lookup_table.meta.last_extended_slot, 0);
Expand Down
2 changes: 1 addition & 1 deletion program/tests/deactivate_lookup_table_ix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fn test_deactivate_lookup_table() {

let lookup_table_account = result.get_account(&lookup_table_address).unwrap();

let lookup_table = AddressLookupTable::deserialize(&lookup_table_account.data()).unwrap();
let lookup_table = AddressLookupTable::deserialize(lookup_table_account.data()).unwrap();
assert_eq!(lookup_table.meta.deactivation_slot, 0);

// Check that only the deactivation slot changed
Expand Down
2 changes: 1 addition & 1 deletion program/tests/extend_lookup_table_ix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn run_test_case(mollusk: &Mollusk, test_case: TestCase) {
assert!(matches!(result.program_result, ProgramResult::Success));

let table_account = result.get_account(&test_case.lookup_table_address).unwrap();
let lookup_table = AddressLookupTable::deserialize(&table_account.data()).unwrap();
let lookup_table = AddressLookupTable::deserialize(table_account.data()).unwrap();
assert_eq!(lookup_table, expected_account.state);
assert_eq!(table_account.lamports(), expected_account.lamports);
assert_eq!(table_account.data().len(), expected_account.data_len);
Expand Down
2 changes: 1 addition & 1 deletion program/tests/freeze_lookup_table_ix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn test_freeze_lookup_table() {
);

let lookup_table_account = result.get_account(&lookup_table_address).unwrap();
let lookup_table = AddressLookupTable::deserialize(&lookup_table_account.data()).unwrap();
let lookup_table = AddressLookupTable::deserialize(lookup_table_account.data()).unwrap();

assert_eq!(lookup_table.meta.authority, None);

Expand Down
1 change: 1 addition & 0 deletions scripts/client/lint-rust.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
// Configure arguments here.
const lintArgs = [
'-Zunstable-options',
'--all-targets',
'--',
'--deny=warnings',
...cliArguments(),
Expand Down
4 changes: 2 additions & 2 deletions scripts/program/lint.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import {
// Configure arguments here.
const lintArgs = [
'-Zunstable-options',
'--features',
'bpf-entrypoint,test-sbf',
'--all-targets',
'--all-features',
'--',
'--deny=warnings',
'--deny=clippy::arithmetic_side_effects',
Expand Down

0 comments on commit 41b747d

Please sign in to comment.