-
Notifications
You must be signed in to change notification settings - Fork 0
chore: add minimal solhint config #13
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,3 +12,7 @@ docs/ | |
|
|
||
| # Dotenv file | ||
| .env | ||
|
|
||
| # Local development dependencies | ||
| dev/node_modules/ | ||
| dev/.venv/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "extends": "solhint:recommended", | ||
| "rules": { | ||
| "compiler-version": ["error", "^0.8"], | ||
| "import-path-check": "off", | ||
| "use-natspec": "warn" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| lib/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,6 @@ This project is meant to be used as a templated during the creation of new Githu | |
|
|
||
| It will contain some useful configuration files and scripts, that can be used also with existing projects (manually copied). | ||
|
|
||
|
|
||
| ## Usage | ||
|
|
||
| ### Build | ||
|
|
@@ -27,6 +26,35 @@ forge test | |
| forge fmt | ||
| ``` | ||
|
|
||
| ### Local tooling | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I find the section a bit stange. We have Local tooling is also |
||
|
|
||
| Solhint and Slither are pinned as local development dependencies under `dev/`. | ||
| Install them with: | ||
|
|
||
| ```shell | ||
| npm install --prefix dev | ||
| python -m venv dev/.venv | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no need to change for Mac users, but just so you know, we need to use |
||
| dev/.venv/bin/pip install -r dev/requirements.txt | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no such a file |
||
| ``` | ||
|
|
||
| Use the local binaries when running these tools: | ||
|
|
||
| ```shell | ||
| dev/node_modules/.bin/solhint --version | ||
| dev/.venv/bin/slither --version | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible you are mixing things from another PR? |
||
| ``` | ||
|
|
||
| ### Solhint | ||
|
|
||
| Solhint uses the pinned local binary: | ||
|
|
||
| ```shell | ||
| dev/node_modules/.bin/solhint --max-warnings 0 '**/*.sol' | ||
| ``` | ||
|
|
||
| The root config applies to all Solidity files. | ||
| The `script/` and `test/` folders have a small override config for their own style. | ||
|
|
||
| ### Gas Snapshots | ||
|
|
||
| ```shell | ||
|
|
@@ -44,18 +72,18 @@ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --priva | |
| The following operations need to be performed after this repository has been created. | ||
|
|
||
| - [ ] In GitHub repo settings: | ||
| - [ ] Add a new ruleset called "Protected branches" and include the following changes: | ||
| - Enforcement status: active | ||
| - Target branches: Include default branch | ||
| - Require linear history | ||
| - Require a pull request before merging | ||
| - Required approvals: 1 | ||
| - Allowed merge methods: Squash | ||
| - Block force pushes | ||
| - [ ] In General → Features → Pull requests: | ||
| - Select "Pull request title and description" in "Default commit message" option | ||
| - Unckeck "Allow merge commits" option | ||
| - Check "Allow auto-merge" option | ||
| - [ ] Add a new ruleset called "Protected branches" and include the following changes: | ||
| - Enforcement status: active | ||
| - Target branches: Include default branch | ||
| - Require linear history | ||
| - Require a pull request before merging | ||
| - Required approvals: 1 | ||
| - Allowed merge methods: Squash | ||
| - Block force pushes | ||
| - [ ] In General → Features → Pull requests: | ||
| - Select "Pull request title and description" in "Default commit message" option | ||
| - Unckeck "Allow merge commits" option | ||
| - Check "Allow auto-merge" option | ||
| - [ ] Run `forge install` to install the dependencies. This will create a new `foundry.lock` file which you should commit to the project | ||
| - [ ] Make sure you use the [latest version of Solidity](https://github.com/argotorg/solidity/releases) by updating the `solc` version in `foundry.toml` | ||
| - [ ] Once all entries in this list are checked, delete this section from the readme | ||
| - [ ] Once all entries in this list are checked, delete this section from the readme | ||
Uh oh!
There was an error while loading. Please reload this page.