Skip to content

Commit

Permalink
cli: add --skip-lint option (#1482)
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-schaaf committed Feb 21, 2022
1 parent 4059682 commit c0b2fd7
Show file tree
Hide file tree
Showing 27 changed files with 95 additions and 82 deletions.
48 changes: 24 additions & 24 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ jobs:
name: anchor-binary
path: ~/.cargo/bin/
- run: chmod +rwx ~/.cargo/bin/anchor
- run: cd ${{ matrix.node.path }} && anchor build
- run: cd ${{ matrix.node.path }} && anchor build --skip-lint
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.node.name }}
Expand Down Expand Up @@ -224,9 +224,9 @@ jobs:
name: start validator
- run: cd tests/bpf-upgradeable-state && yarn
- run: cd tests/bpf-upgradeable-state && yarn link @project-serum/anchor
- run: cd tests/bpf-upgradeable-state && anchor build
- run: cd tests/bpf-upgradeable-state && anchor build --skip-lint
- run: cd tests/bpf-upgradeable-state && solana program deploy --program-id program_with_different_programdata.json target/deploy/bpf_upgradeable_state.so
- run: cd tests/bpf-upgradeable-state && cp bpf_upgradeable_state-keypair.json target/deploy/bpf_upgradeable_state-keypair.json && anchor deploy && anchor test --skip-deploy --skip-build
- run: cd tests/bpf-upgradeable-state && cp bpf_upgradeable_state-keypair.json target/deploy/bpf_upgradeable_state-keypair.json && anchor deploy && anchor test --skip-deploy --skip-build --skip-lint

test-programs:
needs: setup-anchor-cli
Expand All @@ -236,49 +236,49 @@ jobs:
fail-fast: false
matrix:
node:
- cmd: cd tests/sysvars && anchor test
- cmd: cd tests/sysvars && anchor test --skip-lint
path: tests/sysvars
- cmd: cd tests/composite && anchor test
- cmd: cd tests/composite && anchor test --skip-lint
path: tests/composite
- cmd: cd tests/errors && anchor test
- cmd: cd tests/errors && anchor test --skip-lint
path: tests/errors
- cmd: cd tests/spl/token-proxy && anchor test
- cmd: cd tests/spl/token-proxy && anchor test --skip-lint
path: spl/token-proxy
- cmd: cd tests/multisig && anchor test
- cmd: cd tests/multisig && anchor test --skip-lint
path: tests/multisig
- cmd: cd tests/interface && anchor test
- cmd: cd tests/interface && anchor test --skip-lint
path: tests/interface
- cmd: cd tests/lockup && anchor test
- cmd: cd tests/lockup && anchor test --skip-lint
path: tests/lockup
- cmd: cd tests/swap/deps/serum-dex/dex && cargo build-bpf && cd ../../../ && anchor test
- cmd: cd tests/swap/deps/serum-dex/dex && cargo build-bpf && cd ../../../ && anchor test --skip-lint
path: tests/swap
- cmd: cd tests/escrow && anchor test
- cmd: cd tests/escrow && anchor test --skip-lint
path: tests/escrow
- cmd: cd tests/pyth && anchor test
- cmd: cd tests/pyth && anchor test --skip-lint
path: tests/pyth
- cmd: cd tests/system-accounts && anchor test
- cmd: cd tests/system-accounts && anchor test --skip-lint
path: tests/system-accounts
- cmd: cd tests/misc && anchor test
- cmd: cd tests/misc && anchor test --skip-lint
path: tests/misc
- cmd: cd tests/events && anchor test
- cmd: cd tests/events && anchor test --skip-lint
path: tests/events
- cmd: cd tests/cashiers-check && anchor test
- cmd: cd tests/cashiers-check && anchor test --skip-lint
path: tests/cashiers-check
- cmd: cd tests/declare-id && anchor test
- cmd: cd tests/declare-id && anchor test --skip-lint
path: tests/declare-id
- cmd: cd tests/typescript && anchor test
- cmd: cd tests/typescript && anchor test --skip-lint
path: tests/typescript
- cmd: cd tests/zero-copy && anchor test && cd programs/zero-copy && cargo test-bpf
- cmd: cd tests/zero-copy && anchor test --skip-lint && cd programs/zero-copy && cargo test-bpf
path: tests/zero-copy
- cmd: cd tests/chat && anchor test
- cmd: cd tests/chat && anchor test --skip-lint
path: tests/chat
- cmd: cd tests/ido-pool && anchor test
- cmd: cd tests/ido-pool && anchor test --skip-lint
path: tests/ido-pool
- cmd: cd tests/cfo && anchor run test-with-build
path: tests/cfo
- cmd: cd tests/auction-house && yarn && anchor test
- cmd: cd tests/auction-house && yarn && anchor test --skip-lint
path: tests/auction-house
- cmd: cd tests/floats && yarn && anchor test
- cmd: cd tests/floats && yarn && anchor test --skip-lint
path: tests/floats
- cmd: cd tests/safety-checks && ./test.sh
path: tests/safety-checks
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ incremented for features.

* lang: add check that declared id == program id ([#1451](https://github.com/project-serum/anchor/pull/1451))
* ts: Added float types support ([#1425](https://github.com/project-serum/anchor/pull/1425)).
* cli: Add `--skip-lint` option to disable check linting introduced in ([#1452](https://github.com/project-serum/anchor/pull/1452)) for rapid prototyping ([#1482](https://github.com/project-serum/anchor/pull/1482))

### Fixes

Expand Down
18 changes: 1 addition & 17 deletions cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,26 +257,10 @@ pub struct Config {
pub test: Option<Test>,
}

#[derive(Clone, Debug, Serialize, Deserialize)]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct FeaturesConfig {
#[serde(default)]
pub seeds: bool,
#[serde(default = "default_safety_checks")]
pub safety_checks: bool,
}

impl Default for FeaturesConfig {
fn default() -> Self {
Self {
seeds: false,
// Anchor safety checks on by default
safety_checks: true,
}
}
}

fn default_safety_checks() -> bool {
true
}

#[derive(Clone, Debug, Serialize, Deserialize)]
Expand Down
Loading

0 comments on commit c0b2fd7

Please sign in to comment.