Skip to content
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
62 changes: 62 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Lint crates

on:
workflow_dispatch:
pull_request:
branches:
- master

env:
CARGO_TERM_COLOR: always
RUST_VERSION: "1.86"

jobs:
Lint-Workspace:
name: Lint Workspace
runs-on: ubuntu-24.04
steps:
- run: echo "Starting Lint-Workspace"

lint:
name: Lint
needs: Lint-Workspace
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3


- name: Install system packages
run: sudo apt-get update && sudo apt-get install -y build-essential libudev-dev protobuf-compiler libprotobuf-dev
shell: bash

- name: Rust Cache
id: rust-cache
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
shared-key: "trident-idl-spec-lint"
key: lint-${{ runner.os }}
workspaces: |
./

- name: Install Rust Toolchain Components
run: |
rustup install nightly
rustup component add rustfmt clippy
rustup component add rustfmt clippy --toolchain nightly
shell: bash

- name: Format
run: make format-checks
- name: Clippy
run: make clippy
- name: Test
run: make test


checks:
name: Lint-Workspace (Checks)
needs: lint
runs-on: ubuntu-24.04
steps:
- run: echo "Lint Workspace completed successfully"
1 change: 1 addition & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
imports_granularity = "Item"
68 changes: 55 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "trident-idl-spec"
authors = ["Ackee Blockchain Security <hello@ackee.xyz>"]
version = "0.0.2"
version = "0.0.3"
edition = "2021"
repository = "https://github.com/Ackee-Blockchain/trident-idl-spec"
license-file = "./LICENSE"
Expand All @@ -11,3 +11,6 @@ description = "Custom implementation of IDL specification for the Trident fuzzin
serde = { version = "1.0", features = ["derive"] }
syn = { version = "2", features = ["visit", "full"] }
quote = "1"

[dev-dependencies]
serde_json = "1.0"
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

format:
cargo +nightly fmt

install:
cargo install --path .

format-checks:
cargo +nightly fmt --check

clippy:
cargo clippy -- -D warnings

test:
cargo test
7 changes: 7 additions & 0 deletions examples/internal-test/idl-test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.anchor
.DS_Store
target
**/*.rs.bk
node_modules
test-ledger
.yarn
7 changes: 7 additions & 0 deletions examples/internal-test/idl-test/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.anchor
.DS_Store
target
node_modules
dist
build
test-ledger
20 changes: 20 additions & 0 deletions examples/internal-test/idl-test/Anchor.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[toolchain]
anchor_version = "0.32.1"

[features]
resolution = true
skip-lint = false

[programs.localnet]
additional-program = "8bPSKGoWCdAW8Hu3S1hLHPpBv8BNwse4jDyaXNrj3jWB"
idl_test = "HtD1eaPZ1JqtxcirNtYt3aAhUMoJWZ2Ddtzu4NDZCrhN"

[registry]
url = "https://api.apr.dev"

[provider]
cluster = "Localnet"
wallet = "~/.config/solana/id.json"

[scripts]
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
Loading