chore: Add husky-rs git pre-push hook to clippy and fmt#5002
chore: Add husky-rs git pre-push hook to clippy and fmt#5002jedel1043 merged 3 commits intoboa-dev:mainfrom
Conversation
Test262 conformance changes
Broken tests (1):Tested main commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5002 +/- ##
===========================================
+ Coverage 47.24% 58.42% +11.18%
===========================================
Files 476 559 +83
Lines 46892 61459 +14567
===========================================
+ Hits 22154 35910 +13756
- Misses 24738 25549 +811 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
.husky/pre-push
Outdated
| echo "Running cargo fmt check..." | ||
| cargo fmt --all -- --check | ||
| if [ $? -ne 0 ]; then | ||
| echo "cargo fmt check failed. Run 'cargo fmt --all' to fix formatting." | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Running cargo clippy..." | ||
| cargo clippy --all-targets --all-features -- -D warnings | ||
| if [ $? -ne 0 ]; then | ||
| echo "cargo clippy failed. Fix the warnings above before pushing." | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
I would just run cargo make run-ci TBH. It's an additional step of having to install cargo-make, but we should require it for contributions IMO
There was a problem hiding this comment.
what do you think about just adding a .devcontainer.json ?
then you can add whatever you want in there and make dev environment more consistent.
(at least for people (incl. me) on linux life should get easier)
There was a problem hiding this comment.
and a vscode settings.json could let vscode use cargo to format files on save automatically.
There was a problem hiding this comment.
@jedel1043 done.
@zhuzhu81998 most people don't have dev containers. Husky hooks into git so it always run for sure.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Hi @jedel1043, I ran into an issue with the new pre-push hook on macOS when the shell
MDItem.h:178:69: error: expected ')' before '^' token This happens because the hook inherits One possible fix would be forcing Clang inside export CC=clang If this approach looks reasonable, I can open a PR adding this to the hook. |
That sounds like something you need to fix from your end then? Because adding that in the pre-push script would force Windows contributors to use clang instead of the VS build tools |
|
Maybe we could scope it only to macOS and only when CC isn’t already set, something like: That way it wouldn’t affect Windows or Linux environments. |
|
Honestly we should just kill aws-lc-rs with fire and use ring IMO |
|
Opened #5068 |
No need to do that on every commit, but pushing will help people stop pushing things that fail Lint on CI. Like me. I do that.