Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update lints #76

Merged
merged 6 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
378 changes: 296 additions & 82 deletions Cargo.lock

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions crate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ edition = "2021"
[dependencies]

[dev-dependencies]
assert_cmd = "2.0.8"
predicates = "2.1.5"
tempfile = "3.3.0"
toml = "0.5.10"
assert_cmd = "2.0"
predicates = "3.1"
similar-asserts = "1.5"
tempfile = "3.10"
toml = "0.8"

[package.metadata.rust-analyzer]
rustc_private = true
24 changes: 12 additions & 12 deletions crate/diffs/arbitrary_cpi.diff
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
diff -r ./insecure/Cargo.toml ../../../../lints/arbitrary_cpi/ui/insecure/Cargo.toml
diff -r -x Cargo.lock ./insecure/Cargo.toml ../../../../lints/arbitrary_cpi/ui/insecure/Cargo.toml
19,21c19,22
< anchor-lang = "0.20.1"
< anchor-spl = "0.20.1"
< spl-token = { version = "3.1.1", features = ["no-entrypoint"] }
\ No newline at end of file
---
> anchor-lang = "0.25.0"
> anchor-spl = "0.25.0"
> anchor-lang = "0.29.0"
> anchor-spl = "0.29.0"
>
> [workspace]
diff -r ./insecure/src/lib.rs ../../../../lints/arbitrary_cpi/ui/insecure/src/lib.rs
diff -r -x Cargo.lock ./insecure/src/lib.rs ../../../../lints/arbitrary_cpi/ui/insecure/src/lib.rs
2a3,4
> use anchor_lang::solana_program::entrypoint::ProgramResult;
> use anchor_spl::token::spl_token;
Expand All @@ -18,18 +18,18 @@ diff -r ./insecure/src/lib.rs ../../../../lints/arbitrary_cpi/ui/insecure/src/li
> #[allow(dead_code)]
> fn main() {}
Only in ../../../../lints/arbitrary_cpi/ui: insecure-2
diff -r ./recommended/Cargo.toml ../../../../lints/arbitrary_cpi/ui/recommended/Cargo.toml
diff -r -x Cargo.lock ./recommended/Cargo.toml ../../../../lints/arbitrary_cpi/ui/recommended/Cargo.toml
19,21c19,22
< anchor-lang = "0.20.1"
< anchor-spl = "0.20.1"
< spl-token = { version = "3.1.1", features = ["no-entrypoint"] }
\ No newline at end of file
---
> anchor-lang = "0.25.0"
> anchor-spl = "0.25.0"
> anchor-lang = "0.29.0"
> anchor-spl = "0.29.0"
>
> [workspace]
diff -r ./recommended/src/lib.rs ../../../../lints/arbitrary_cpi/ui/recommended/src/lib.rs
diff -r -x Cargo.lock ./recommended/src/lib.rs ../../../../lints/arbitrary_cpi/ui/recommended/src/lib.rs
10c10
< pub fn cpi(ctx: Context<Cpi>, amount: u64) -> ProgramResult {
---
Expand All @@ -38,17 +38,17 @@ diff -r ./recommended/src/lib.rs ../../../../lints/arbitrary_cpi/ui/recommended/
>
> #[allow(dead_code)]
> fn main() {}
diff -r ./secure/Cargo.toml ../../../../lints/arbitrary_cpi/ui/secure/Cargo.toml
diff -r -x Cargo.lock ./secure/Cargo.toml ../../../../lints/arbitrary_cpi/ui/secure/Cargo.toml
19,21c19,22
< anchor-lang = "0.20.1"
< anchor-spl = "0.20.1"
< spl-token = { version = "3.1.1", features = ["no-entrypoint"] }
---
> anchor-lang = "0.25.0"
> anchor-spl = "0.25.0"
> anchor-lang = "0.29.0"
> anchor-spl = "0.29.0"
>
> [workspace]
diff -r ./secure/src/lib.rs ../../../../lints/arbitrary_cpi/ui/secure/src/lib.rs
diff -r -x Cargo.lock ./secure/src/lib.rs ../../../../lints/arbitrary_cpi/ui/secure/src/lib.rs
2a3,4
> use anchor_lang::solana_program::entrypoint::ProgramResult;
> use anchor_spl::token::spl_token;
Expand Down
18 changes: 9 additions & 9 deletions crate/diffs/bump_seed_canonicalization.diff
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
diff -r ./insecure/Cargo.toml ../../../../lints/bump_seed_canonicalization/ui/insecure/Cargo.toml
diff -r -x Cargo.lock ./insecure/Cargo.toml ../../../../lints/bump_seed_canonicalization/ui/insecure/Cargo.toml
19c19,21
< anchor-lang = "0.20.1"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./insecure/src/lib.rs ../../../../lints/bump_seed_canonicalization/ui/insecure/src/lib.rs
diff -r -x Cargo.lock ./insecure/src/lib.rs ../../../../lints/bump_seed_canonicalization/ui/insecure/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
30a32,34
Expand All @@ -15,28 +15,28 @@ diff -r ./insecure/src/lib.rs ../../../../lints/bump_seed_canonicalization/ui/in
Only in ../../../../lints/bump_seed_canonicalization/ui/insecure/src: lib.stderr
Only in ../../../../lints/bump_seed_canonicalization/ui: insecure-2
Only in ../../../../lints/bump_seed_canonicalization/ui: insecure-3
diff -r ./recommended/Cargo.toml ../../../../lints/bump_seed_canonicalization/ui/recommended/Cargo.toml
diff -r -x Cargo.lock ./recommended/Cargo.toml ../../../../lints/bump_seed_canonicalization/ui/recommended/Cargo.toml
19c19,21
< anchor-lang = "0.20.1"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./recommended/src/lib.rs ../../../../lints/bump_seed_canonicalization/ui/recommended/src/lib.rs
diff -r -x Cargo.lock ./recommended/src/lib.rs ../../../../lints/bump_seed_canonicalization/ui/recommended/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
35a37,39
>
> #[allow(dead_code)]
> fn main() {}
diff -r ./secure/Cargo.toml ../../../../lints/bump_seed_canonicalization/ui/secure/Cargo.toml
diff -r -x Cargo.lock ./secure/Cargo.toml ../../../../lints/bump_seed_canonicalization/ui/secure/Cargo.toml
19c19,21
< anchor-lang = "0.20.1"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./secure/src/lib.rs ../../../../lints/bump_seed_canonicalization/ui/secure/src/lib.rs
diff -r -x Cargo.lock ./secure/src/lib.rs ../../../../lints/bump_seed_canonicalization/ui/secure/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
38a40,42
Expand Down
30 changes: 15 additions & 15 deletions crate/diffs/insecure_account_close.diff
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
diff -r ./insecure/Cargo.toml ../../../../lints/insecure_account_close/ui/insecure/Cargo.toml
diff -r -x Cargo.lock ./insecure/Cargo.toml ../../../../lints/insecure_account_close/ui/insecure/Cargo.toml
19c19,21
< anchor-lang = "0.20.1"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./insecure/src/lib.rs ../../../../lints/insecure_account_close/ui/insecure/src/lib.rs
diff -r -x Cargo.lock ./insecure/src/lib.rs ../../../../lints/insecure_account_close/ui/insecure/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
30a32,34
>
> #[allow(dead_code)]
> fn main() {}
Only in ../../../../lints/insecure_account_close/ui/insecure/src: lib.stderr
diff -r ./insecure-still/Cargo.toml ../../../../lints/insecure_account_close/ui/insecure-still/Cargo.toml
diff -r -x Cargo.lock ./insecure-still/Cargo.toml ../../../../lints/insecure_account_close/ui/insecure-still/Cargo.toml
19c19,21
< anchor-lang = "0.20.1"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./insecure-still/src/lib.rs ../../../../lints/insecure_account_close/ui/insecure-still/src/lib.rs
diff -r -x Cargo.lock ./insecure-still/src/lib.rs ../../../../lints/insecure_account_close/ui/insecure-still/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
45a47,49
>
> #[allow(dead_code)]
> fn main() {}
Only in ../../../../lints/insecure_account_close/ui/insecure-still/src: lib.stderr
diff -r ./insecure-still-still/Cargo.toml ../../../../lints/insecure_account_close/ui/insecure-still-still/Cargo.toml
diff -r -x Cargo.lock ./insecure-still-still/Cargo.toml ../../../../lints/insecure_account_close/ui/insecure-still-still/Cargo.toml
19c19,21
< anchor-lang = "0.20.1"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./insecure-still-still/src/lib.rs ../../../../lints/insecure_account_close/ui/insecure-still-still/src/lib.rs
diff -r -x Cargo.lock ./insecure-still-still/src/lib.rs ../../../../lints/insecure_account_close/ui/insecure-still-still/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
45a47,49
>
> #[allow(dead_code)]
> fn main() {}
Only in ../../../../lints/insecure_account_close/ui/insecure-still-still/src: lib.stderr
diff -r ./recommended/Cargo.toml ../../../../lints/insecure_account_close/ui/recommended/Cargo.toml
diff -r -x Cargo.lock ./recommended/Cargo.toml ../../../../lints/insecure_account_close/ui/recommended/Cargo.toml
19c19,21
< anchor-lang = "0.20.1"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./recommended/src/lib.rs ../../../../lints/insecure_account_close/ui/recommended/src/lib.rs
diff -r -x Cargo.lock ./recommended/src/lib.rs ../../../../lints/insecure_account_close/ui/recommended/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
18d18
Expand All @@ -60,14 +60,14 @@ diff -r ./recommended/src/lib.rs ../../../../lints/insecure_account_close/ui/rec
> #[allow(dead_code)]
> fn main() {}
Only in ../../../../lints/insecure_account_close/ui/recommended/src: lib.stderr
diff -r ./secure/Cargo.toml ../../../../lints/insecure_account_close/ui/secure/Cargo.toml
diff -r -x Cargo.lock ./secure/Cargo.toml ../../../../lints/insecure_account_close/ui/secure/Cargo.toml
19c19,21
< anchor-lang = "0.20.1"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./secure/src/lib.rs ../../../../lints/insecure_account_close/ui/secure/src/lib.rs
diff -r -x Cargo.lock ./secure/src/lib.rs ../../../../lints/insecure_account_close/ui/secure/src/lib.rs
2a3
> use anchor_lang::solana_program::entrypoint::ProgramResult;
71a73,75
Expand Down
24 changes: 12 additions & 12 deletions crate/diffs/missing_owner_check.diff
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
diff -r ./insecure/Cargo.toml ../../../../lints/missing_owner_check/ui/insecure/Cargo.toml
diff -r -x Cargo.lock ./insecure/Cargo.toml ../../../../lints/missing_owner_check/ui/insecure/Cargo.toml
19,21c19,22
< anchor-lang = "0.20.1"
< anchor-spl = "0.20.1"
< spl-token = "3.2.0"
---
> anchor-lang = "0.25.0"
> anchor-spl = "0.25.0"
> anchor-lang = "0.29.0"
> anchor-spl = "0.29.0"
>
> [workspace]
diff -r ./insecure/src/lib.rs ../../../../lints/missing_owner_check/ui/insecure/src/lib.rs
diff -r -x Cargo.lock ./insecure/src/lib.rs ../../../../lints/missing_owner_check/ui/insecure/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
4c5
Expand All @@ -20,35 +20,35 @@ diff -r ./insecure/src/lib.rs ../../../../lints/missing_owner_check/ui/insecure/
> #[allow(dead_code)]
> fn main() {}
Only in ../../../../lints/missing_owner_check/ui/insecure/src: lib.stderr
diff -r ./recommended/Cargo.toml ../../../../lints/missing_owner_check/ui/recommended/Cargo.toml
diff -r -x Cargo.lock ./recommended/Cargo.toml ../../../../lints/missing_owner_check/ui/recommended/Cargo.toml
19,21c19,22
< anchor-lang = "0.20.1"
< anchor-spl = "0.20.1"
< spl-token = "3.2.0"
---
> anchor-lang = "0.25.0"
> anchor-spl = "0.25.0"
> anchor-lang = "0.29.0"
> anchor-spl = "0.29.0"
>
> [workspace]
diff -r ./recommended/src/lib.rs ../../../../lints/missing_owner_check/ui/recommended/src/lib.rs
diff -r -x Cargo.lock ./recommended/src/lib.rs ../../../../lints/missing_owner_check/ui/recommended/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
21a23,25
>
> #[allow(dead_code)]
> fn main() {}
Only in ../../../../lints/missing_owner_check/ui/recommended/src: lib.stderr
diff -r ./secure/Cargo.toml ../../../../lints/missing_owner_check/ui/secure/Cargo.toml
diff -r -x Cargo.lock ./secure/Cargo.toml ../../../../lints/missing_owner_check/ui/secure/Cargo.toml
19,21c19,22
< anchor-lang = "0.20.1"
< anchor-spl = "0.20.1"
< spl-token = "3.2.0"
---
> anchor-lang = "0.25.0"
> anchor-spl = "0.25.0"
> anchor-lang = "0.29.0"
> anchor-spl = "0.29.0"
>
> [workspace]
diff -r ./secure/src/lib.rs ../../../../lints/missing_owner_check/ui/secure/src/lib.rs
diff -r -x Cargo.lock ./secure/src/lib.rs ../../../../lints/missing_owner_check/ui/secure/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
4c5,6
Expand Down
18 changes: 9 additions & 9 deletions crate/diffs/missing_signer_check.diff
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
diff -r ./insecure/Cargo.toml ../../../../lints/missing_signer_check/ui/insecure/Cargo.toml
diff -r -x Cargo.lock ./insecure/Cargo.toml ../../../../lints/missing_signer_check/ui/insecure/Cargo.toml
19c19,21
< anchor-lang = "0.20.0"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./insecure/src/lib.rs ../../../../lints/missing_signer_check/ui/insecure/src/lib.rs
diff -r -x Cargo.lock ./insecure/src/lib.rs ../../../../lints/missing_signer_check/ui/insecure/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
3a5
Expand All @@ -15,29 +15,29 @@ diff -r ./insecure/src/lib.rs ../../../../lints/missing_signer_check/ui/insecure
> #[allow(dead_code)]
> fn main() {}
Only in ../../../../lints/missing_signer_check/ui/insecure/src: lib.stderr
diff -r ./recommended/Cargo.toml ../../../../lints/missing_signer_check/ui/recommended/Cargo.toml
diff -r -x Cargo.lock ./recommended/Cargo.toml ../../../../lints/missing_signer_check/ui/recommended/Cargo.toml
19c19,21
< anchor-lang = "0.20.0"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./recommended/src/lib.rs ../../../../lints/missing_signer_check/ui/recommended/src/lib.rs
diff -r -x Cargo.lock ./recommended/src/lib.rs ../../../../lints/missing_signer_check/ui/recommended/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
18a20,22
>
> #[allow(dead_code)]
> fn main() {}
Only in ../../../../lints/missing_signer_check/ui/recommended/src: lib.stderr
diff -r ./secure/Cargo.toml ../../../../lints/missing_signer_check/ui/secure/Cargo.toml
diff -r -x Cargo.lock ./secure/Cargo.toml ../../../../lints/missing_signer_check/ui/secure/Cargo.toml
19c19,21
< anchor-lang = "0.20.0"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./secure/src/lib.rs ../../../../lints/missing_signer_check/ui/secure/src/lib.rs
diff -r -x Cargo.lock ./secure/src/lib.rs ../../../../lints/missing_signer_check/ui/secure/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
21a23,25
Expand Down
18 changes: 9 additions & 9 deletions crate/diffs/type_cosplay.diff
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
diff -r ./insecure/Cargo.toml ../../../../lints/type_cosplay/ui/insecure/Cargo.toml
diff -r -x Cargo.lock ./insecure/Cargo.toml ../../../../lints/type_cosplay/ui/insecure/Cargo.toml
19c19,21
< anchor-lang = "0.20.1"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./insecure/src/lib.rs ../../../../lints/type_cosplay/ui/insecure/src/lib.rs
diff -r -x Cargo.lock ./insecure/src/lib.rs ../../../../lints/type_cosplay/ui/insecure/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
37a39,41
Expand All @@ -16,14 +16,14 @@ Only in ../../../../lints/type_cosplay/ui/insecure/src: lib.stderr
Only in ../../../../lints/type_cosplay/ui: insecure-2
Only in ../../../../lints/type_cosplay/ui: insecure-3
Only in ../../../../lints/type_cosplay/ui: insecure-anchor
diff -r ./recommended/Cargo.toml ../../../../lints/type_cosplay/ui/recommended/Cargo.toml
diff -r -x Cargo.lock ./recommended/Cargo.toml ../../../../lints/type_cosplay/ui/recommended/Cargo.toml
19c19,21
< anchor-lang = "0.20.1"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./recommended/src/lib.rs ../../../../lints/type_cosplay/ui/recommended/src/lib.rs
diff -r -x Cargo.lock ./recommended/src/lib.rs ../../../../lints/type_cosplay/ui/recommended/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
31a33,35
Expand All @@ -32,14 +32,14 @@ diff -r ./recommended/src/lib.rs ../../../../lints/type_cosplay/ui/recommended/s
> fn main() {}
Only in ../../../../lints/type_cosplay/ui/recommended/src: lib.stderr
Only in ../../../../lints/type_cosplay/ui: recommended-2
diff -r ./secure/Cargo.toml ../../../../lints/type_cosplay/ui/secure/Cargo.toml
diff -r -x Cargo.lock ./secure/Cargo.toml ../../../../lints/type_cosplay/ui/secure/Cargo.toml
19c19,21
< anchor-lang = "0.20.1"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./secure/src/lib.rs ../../../../lints/type_cosplay/ui/secure/src/lib.rs
diff -r -x Cargo.lock ./secure/src/lib.rs ../../../../lints/type_cosplay/ui/secure/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
48a50,52
Expand Down
3 changes: 3 additions & 0 deletions crate/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

extern crate rustc_hir;

#[allow(unused_extern_crates)]
extern crate rustc_driver;

pub mod paths;

pub mod utils;
Loading
Loading