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

ci: use lintspec instead of natspec-smells #98

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
12 changes: 11 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ jobs:
with:
version: stable

- name: Install lintspec via cargo
uses: baptiste0928/cargo-install@v3
with:
crate: lintspec
version: '0.3.0'

- name: Use Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -132,4 +138,8 @@ jobs:
- name: Install dependencies
run: yarn --frozen-lockfile --network-concurrency 1

- run: yarn lint:check
- name: Run solhint and forge-fmt
run: yarn lint:check

- name: Run lintspec
run: yarn lint:natspec
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@

1. Install Foundry by following the instructions from [their repository](https://github.com/foundry-rs/foundry#installation).
2. Copy the `.env.example` file to `.env` and fill in the variables.
3. Install the dependencies by running: `yarn install`. In case there is an error with the commands, run `foundryup` and try them again.
3. Install rust dependencies: `cargo install lintspec`
4. Install the dependencies by running: `yarn install`. In case there is an error with the commands, run `foundryup` and try them again.

## Build

Expand Down
9 changes: 0 additions & 9 deletions natspec-smells.config.js

This file was deleted.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"deploy:sepolia": "bash -c 'source .env && forge script Deploy --rpc-url $SEPOLIA_RPC --account $SEPOLIA_DEPLOYER_NAME --broadcast --verify --chain sepolia -vvvvv'",
"lint:check": "yarn lint:sol && forge fmt --check",
"lint:fix": "sort-package-json && forge fmt && yarn lint:sol --fix",
"lint:natspec": "npx @defi-wonderland/natspec-smells --config natspec-smells.config.js",
"lint:natspec": "lintspec src -f variable",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how come you are using lintspec here without adding it to the package.json? I believe the dependency is missing, I don't recommend expecting people to instal it globally

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lintspec is not distributed via npm. CI installs it via a specific action for cargo packages, and I modified the README to instruct users to install it globally via cargo. I think this is acceptable given it's what we already do for bulloak. Other alternatives are:

  • push to get lintspec released on npm (should be possible to distribute a binary I think)
  • migrate the entire boilerplate to use nix instead of npm?

"lint:sol": "solhint 'src/**/*.sol' 'script/**/*.sol' 'test/**/*.sol'",
"prepare": "husky",
"test": "forge test -vvv",
Expand All @@ -35,7 +35,6 @@
"devDependencies": {
"@commitlint/cli": "19.3.0",
"@commitlint/config-conventional": "19.2.2",
"@defi-wonderland/natspec-smells": "1.1.6",
"forge-std": "github:foundry-rs/forge-std#1.9.2",
"halmos-cheatcodes": "github:a16z/halmos-cheatcodes#c0d8655",
"husky": ">=9",
Expand Down
Loading
Loading