Merge pull request #7 from NethermindEth/docs/api-reference-struct-ev… #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Run forge lint; strip SBE/CBOR-only findings from the log and allow CI to pass for those. | |
| # Solidity style guide and FixDescriptorKit use initialisms in caps (getFixSBEChunk, | |
| # pathCBOR, fixSBEPtr). We keep that convention and ignore those lint findings in CI. | |
| name: Lint | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Foundry | |
| uses: foundry-rs/foundry-toolchain@v1 | |
| with: | |
| version: stable | |
| - name: Install npm dependencies | |
| run: npm ci | |
| - name: Run forge lint (filter out SBE/CBOR findings from output) | |
| run: | | |
| forge lint > lint.log 2>&1 | |
| exitcode=$? | |
| # Remove entire finding blocks that mention SBE or CBOR (case-insensitive), show the rest | |
| awk ' | |
| /^note\[|^warning\[|^error\[/ { | |
| if (block != "" && block !~ /SBE|CBOR|sbe|cbor/) print block | |
| block = $0 | |
| next | |
| } | |
| { block = block "\n" $0 } | |
| END { | |
| if (block != "" && block !~ /SBE|CBOR|sbe|cbor/) print block | |
| } | |
| ' lint.log > filtered.log | |
| echo "--- forge lint (SBE/CBOR-related findings removed) ---" | |
| cat filtered.log | |
| echo "---" | |
| if [ "$exitcode" -eq 0 ]; then | |
| echo "Lint passed." | |
| exit 0 | |
| fi | |
| # Lint failed: fail CI only if there are findings that are not SBE/CBOR-related | |
| if grep -q -E '^note\[|^warning\[|^error\[' filtered.log; then | |
| echo "Lint failed (see above)." | |
| exit 1 | |
| fi | |
| echo "Remaining findings were only SBE/CBOR casing; ignored (Solidity style guide + FixDescriptorKit convention)." | |
| exit 0 |