farcasterxyz / contracts

Implementation of the Farcaster contracts
https://www.farcaster.xyz/
MIT License
340 stars 122 forks source link

chore: use forge fmt --check to fail hook correctly #247

Closed varunsrin closed 1 year ago

varunsrin commented 1 year ago

Motivation

The current hook runs the forge fmt without --check which formats files with issues silently, but doesn't check them in causing CI to fail when pushed later.

Change Summary

Change to fail loudly when committing if the any files have formatting issues, so that they must be fixed before a commit is made.

Merge Checklist


PR-Codex overview

This PR focuses on updating the pre-commit command in .rusty-hook.toml to include the --check flag for forge fmt, ensuring code formatting is checked. Additionally, the verbose flag is set to true in the [logging] section.

Detailed summary

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

github-actions[bot] commented 1 year ago

Coverage after merging varunsrin/hook-forge-fmt-check into main will be

98.79%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   Bundler.sol94.12%83.33%100%100%125, 127
   FnameResolver.sol96.30%75%100%100%121
   IdRegistry.sol97.30%100%92.31%97.44%315
   StorageRent.sol98.85%98.44%100%98.90%468, 470