-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update formatting, add pre-commit hooks and ci
- Loading branch information
1 parent
cfeda5b
commit b085a76
Showing
12 changed files
with
2,616 additions
and
1,721 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,5 @@ | ||
#!/bin/env sh | ||
|
||
cargo fmt || exit 1 | ||
cargo check || exit 1 | ||
cargo check --release || exit 1 |
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,3 @@ | ||
#!/bin/env sh | ||
|
||
exec .githooks/pre-commit |
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,66 @@ | ||
on: | ||
workflow_dispatch: | ||
push: | ||
pull_request: | ||
branches: [main] | ||
|
||
name: Build | ||
|
||
jobs: | ||
check: | ||
name: Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install nightly toolchain | ||
uses: dtolnay/rust-toolchain@nightly | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
shared-key: "build" | ||
|
||
- name: Run check | ||
run: cargo check | ||
|
||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
env: | ||
RUST_BACKTRACE: 1 | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install nightly toolchain | ||
uses: dtolnay/rust-toolchain@nightly | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
shared-key: "build" | ||
|
||
- name: Run cargo test | ||
run: cargo test --workspace | ||
|
||
lints: | ||
name: Lints | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install nightly toolchain | ||
uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
components: rustfmt, clippy | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
shared-key: "build" | ||
|
||
- name: Run cargo fmt | ||
run: cargo fmt --all --check | ||
|
||
- name: Run cargo clippy | ||
run: cargo clippy --workspace -- -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 @@ | ||
use_small_heuristics = "Max" | ||
enum_discrim_align_threshold = 16 | ||
struct_field_align_threshold = 16 | ||
fn_params_layout = "Compressed" | ||
|
||
brace_style = "PreferSameLine" | ||
fn_single_line = true | ||
max_width = 150 | ||
hard_tabs = true |
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,6 @@ | ||
#!/bin/env sh | ||
|
||
chmod 744 .githooks/pre-commit | ||
chmod 744 .githooks/pre-commit.wrapper | ||
cp .githooks/pre-commit.wrapper .git/hooks/pre-commit | ||
chmod 744 .git/hooks/pre-commit |
Oops, something went wrong.