Skip to content

Commit

Permalink
chore: pre-push hook replacing cargo check workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tienshaoku committed Nov 1, 2024
1 parent 3a92f2d commit 0a7f284
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/rust-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,8 @@ jobs:
- uses: actions-rs/toolchain@v1
with: # input params for this action
toolchain: stable
components: rustfmt, clippy
components: rustfmt
override: true

- name: Check compilation
run: cargo check # Run this first - fails fast if code won't compile

- name: Check formatting
run: cargo fmt -- --check

- name: Check clippy
run: cargo clippy # Run this after - catches deeper issues
18 changes: 18 additions & 0 deletions .hooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

echo "Running pre-push checks..."

echo "Running cargo check..."
if ! cargo check; then
echo "❌ cargo check failed"
exit 1
fi

echo "Running cargo check..."
if ! cargo clippy; then
echo "❌ cargo clippy failed"
exit 1
fi

echo "✅ All checks passed!"
exit 0
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ This simple CLI tool lets you monitor your portfolio locally 👌

3. `cargo run` 🥳

### Development Setup

- Configure git hooks by `git config core.hooksPath .hooks`

## Feature

- Total # of tokens owned by all addresses
Expand Down

0 comments on commit 0a7f284

Please sign in to comment.