Skip to content

Commit f7b639a

Browse files
committed
Add quality check and format standards
1 parent d69acdb commit f7b639a

2 files changed

Lines changed: 53 additions & 0 deletions

File tree

.github/workflows/quality.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Code Quality
2+
3+
on:
4+
push:
5+
branches: [ main, clean-up ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
format:
11+
name: Check Formatting
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: dtolnay/rust-toolchain@stable
16+
with:
17+
components: rustfmt
18+
- name: Check formatting
19+
run: cargo fmt -- --check
20+
21+
lint:
22+
name: Clippy Linting
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: dtolnay/rust-toolchain@stable
27+
with:
28+
components: clippy
29+
- name: Run clippy
30+
run: cargo clippy -- -D warnings
31+
32+
check:
33+
name: Check Compilation
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: dtolnay/rust-toolchain@stable
38+
- name: Check code compiles
39+
run: cargo check --all-targets --all-features

.rustfmt.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
max_width = 160
2+
hard_tabs = false
3+
tab_spaces = 4
4+
newline_style = "Unix"
5+
use_small_heuristics = "Default"
6+
reorder_imports = true
7+
reorder_modules = true
8+
remove_nested_parens = true
9+
fn_params_layout = "Tall"
10+
merge_derives = true
11+
use_try_shorthand = false
12+
use_field_init_shorthand = false
13+
force_explicit_abi = true
14+
edition = "2021"

0 commit comments

Comments
 (0)