Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de # v1.4.0
with:
version: nightly
version: "v1.3.6"

- name: Show Forge version
run: |
Expand Down
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Contributing

## Formatting

CI enforces `forge fmt` with a pinned Foundry version (**v1.3.6**) so formatting is
reproducible regardless of your local Foundry. Before committing:

```sh
make fmt # format using the pinned version
make fmt-check # verify (identical to the CI check)
```

`make fmt` installs Foundry v1.3.6 side-by-side on first run — it does not have to be
your default. The initial install switches your active Foundry to v1.3.6; run
`foundryup -u stable` to switch back.
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Foundry version CI uses for `forge fmt`. Pinned so formatting output is
# reproducible regardless of your default Foundry install.
FMT_VER := 1.3.6
FORGE_FMT := $(HOME)/.foundry/versions/v$(FMT_VER)/forge

.PHONY: fmt fmt-check

## Format all Solidity with the pinned Foundry version (installed side-by-side on first run).
fmt:
@[ -x "$(FORGE_FMT)" ] || foundryup -i $(FMT_VER) >/dev/null
@"$(FORGE_FMT)" fmt

## Verify formatting - identical to the CI check.
fmt-check:
@[ -x "$(FORGE_FMT)" ] || foundryup -i $(FMT_VER) >/dev/null
@"$(FORGE_FMT)" fmt --check
Loading