-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from chainwayxyz/dev
Dev
- Loading branch information
Showing
15 changed files
with
358 additions
and
72 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
type-complexity-threshold = 9999 | ||
too-many-arguments-threshold = 20 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
|
||
# Format the code | ||
make fmt | ||
|
||
# Apply fixes | ||
make fix | ||
|
||
# Run checks | ||
make check | ||
|
||
# If checks fail, prevent the commit | ||
if [ $? -ne 0 ]; then | ||
echo "Checks failed. Commit aborted." | ||
exit 1 | ||
fi |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Rust CI | ||
|
||
on: | ||
push: | ||
branches: "main" | ||
pull_request: | ||
branches: "main" | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
fmt-and-clippy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: Swatinem/[email protected] | ||
- name: Version info | ||
run: | | ||
rustc --version | ||
cargo clippy --version | ||
- name: Fmt check | ||
run: | | ||
if ! cargo fmt -- --check ; then | ||
echo "Formatting errors detected, apply make fmt." | ||
exit 1 | ||
fi | ||
- name: Clippy check | ||
run: | | ||
if ! cargo clippy -- -D warnings ; then | ||
echo "Clippy warnings detected, apply proper fixes." | ||
exit 1 | ||
fi | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: Swatinem/[email protected] | ||
- name: Run Tests | ||
run: | | ||
if ! cargo test ; then | ||
echo "Tests failed." | ||
exit 1 | ||
fi |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.PHONY: set-hook fmt fix check | ||
|
||
set-hook: | ||
chmod u+x .githooks/* | ||
git config core.hooksPath .githooks | ||
|
||
fmt: | ||
cargo fmt | ||
|
||
fix: | ||
cargo clippy --fix --allow-dirty --allow-staged | ||
|
||
check: | ||
cargo fmt -- --check | ||
cargo clippy -- -D warnings |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
278356 78623 | ||
2 32 32 | ||
1 32 | ||
2 5 | ||
2 1 2 | ||
1 1 | ||
|
||
2 1 10 15 16 NOT | ||
2 1 15 17 18 NOT | ||
2 1 0 1 3 NOT | ||
2 1 2 3 4 NOT | ||
|
||
|
This file contains 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
Oops, something went wrong.