Foundry's forge fmt that we use at the moment doesn't do much formatting. We previously used prettier with solidity plugin, solhint and slither. I think prettier and solhint would be a good start, unless something better appeared in the last year.
[x] ~Add pnpm to nix shell.~: solhint and prettier are installed with nix.
[x] ~Add pnpm i to shellHook (if it's not too slow).~
[x] Add formatter (prettier).
[x] ~Run prettier on solidity code.~: keep using cargo fmt.
[x] Add linter (solhint).
[x] Run solhint --fix on solidity code. Fix remaining errors by hand.
[x] Add pre-commit hooks for formatting and linting.
[x] Add checks to CI. We can also make the linting step in the CI use nix, this makes the pre-commit hooks easier to stay in sync with the CI.
Foundry's
forge fmt
that we use at the moment doesn't do much formatting. We previously usedprettier
with solidity plugin, solhint andslither
. I thinkprettier
andsolhint
would be a good start, unless something better appeared in the last year.pnpm
to nix shell.~: solhint and prettier are installed with nix.pnpm i
toshellHook
(if it's not too slow).~prettier
on solidity code.~: keep usingcargo fmt
.solhint --fix
on solidity code. Fix remaining errors by hand.At first glance the template https://github.com/paulrberg/foundry-template looks good. We can borrow from there.
We also used the tools in CAPE but since we haven't maintained that code base in a year I think borrowing from
foundry-template
is the better option._Originally posted by @sveitser in https://github.com/EspressoSystems/espresso-sequencer/pull/292#discussion_r1173520750_