Skip to content

Commit ab75123

Browse files
committed
chore: standardize project configuration files and add pre-commit hooks
- Add comprehensive pre-commit hooks for code quality: - Add `check-toml`, `pretty-format-json`, and `pretty-format-toml` hooks - Add `forbid-crlf` and `remove-tabs` for consistent line endings - Add `cargo-test` hook using `nextest` for push events - Standardize TOML file formatting across workspace: - Sort package fields consistently - Normalize dependency declarations - Fix trailing commas and whitespace - Update version constraints and dependencies: - Add `nom = "8.0.0-alpha2"` - Update various workspace dependencies - Clean up configuration files: - Sort deny.toml sections logically - Standardize .cargo/config.toml - Format JSON files consistently
1 parent 7490b44 commit ab75123

File tree

28 files changed

+393
-438
lines changed

28 files changed

+393
-438
lines changed

.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[build]
2-
rustflags = ["--cfg", "tokio_unstable", "-Ctarget-cpu=native"]
2+
rustflags = ["--cfg", "tokio_unstable", "-Ctarget-cpu=native"]

.devcontainer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"name": "Debian",
3-
"forwardPorts": [25565],
3+
"forwardPorts": [
4+
25565
5+
],
46
"features": {
57
"ghcr.io/devcontainers/features/rust:1": {}
68
},

.github/chart/pyproject.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[project]
2-
name = "chart"
3-
version = "0.1.0"
2+
dependencies = [
3+
"matplotlib>=3.9.2",
4+
"numpy>=2.1.2"
5+
]
46
description = "Add your description here"
7+
name = "chart"
58
readme = "README.md"
69
requires-python = ">=3.12"
7-
dependencies = [
8-
"matplotlib>=3.9.2",
9-
"numpy>=2.1.2",
10-
]
10+
version = "0.1.0"

.pre-commit-config.yaml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,31 @@ repos:
2020
description: Detects presence of private keys
2121
- id: check-yaml
2222
description: Validates YAML files
23+
- id: check-toml
2324
- id: mixed-line-ending
2425
args: [ --fix=lf ]
2526
description: Replaces mixed line endings with LF
2627
- id: check-executables-have-shebangs
2728
description: Ensures executable files have shebangs
29+
- id: pretty-format-json
30+
args: [ --autofix, --no-sort-keys ]
31+
description: Checks that JSON files are properly formatted
32+
33+
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
34+
rev: v2.12.0
35+
hooks:
36+
- id: pretty-format-toml
37+
args: [ --autofix ]
38+
description: Formats TOML files
39+
40+
- repo: https://github.com/Lucas-C/pre-commit-hooks
41+
rev: v1.5.4
42+
hooks:
43+
- id: forbid-crlf
44+
description: Prevents CRLF line endings
45+
- id: remove-tabs
46+
description: Replaces tabs with spaces
47+
2848
- repo: local
2949
hooks:
3050
- id: cargo-fmt
@@ -55,4 +75,12 @@ repos:
5575
entry: cargo deny check
5676
language: system
5777
types: [rust]
58-
pass_filenames: false
78+
pass_filenames: false
79+
- id: cargo-test
80+
name: cargo test
81+
description: Run cargo tests
82+
entry: cargo nextest run
83+
language: system
84+
types: [ rust ]
85+
pass_filenames: false
86+
stages: [ push ] # Only run on push, not every commit

Cargo.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[profile]
2+
23
[profile.release-debug]
34
debug = true
45
inherits = 'release'
@@ -28,7 +29,7 @@ members = [
2829
'crates/hyperion-utils',
2930
'events/proof-of-concept',
3031
'crates/hyperion-circle-buf',
31-
'crates/hyperion-permission',
32+
'crates/hyperion-permission'
3233
]
3334
resolver = '2'
3435

@@ -38,7 +39,6 @@ approx = '0.5.1'
3839
arrayvec = '0.7.4'
3940
base64 = '0.22.1'
4041
bitfield-struct = '0.9.2'
41-
nom = "8.0.0-alpha2"
4242
bitvec = '1.0.1'
4343
bumpalo = '3.16'
4444
byteorder = '1.5.0'
@@ -62,6 +62,7 @@ libdeflater = '1.20.0'
6262
memmap2 = '0.9.5'
6363
more-asserts = '0.3.1'
6464
no_denormals = '0.1.2'
65+
nom = "8.0.0-alpha2"
6566
once_cell = '1.19.0'
6667
ordered-float = '4.2.0'
6768
ouroboros = '0.18.4'
@@ -82,7 +83,7 @@ thiserror = '1.0.63'
8283
tikv-jemallocator = '0.6.0'
8384
tokio = '1.40.0'
8485
toml = '0.8.14'
85-
tracing-tracy = { version = "0.11.3", features = ["timer-fallback"] }
86+
tracing-tracy = {version = "0.11.3", features = ["timer-fallback"]}
8687
uuid = '1.8.0'
8788

8889
[workspace.dependencies.bvh]
@@ -219,6 +220,7 @@ branch = 'feat-open'
219220
git = 'https://github.com/andrewgazelka/valence'
220221

221222
[workspace.lints]
223+
222224
[workspace.lints.clippy]
223225
cast_precision_loss = 'allow'
224226
future_not_send = 'allow'
@@ -254,6 +256,7 @@ level = 'deny'
254256
priority = -1
255257

256258
[workspace.lints.rust]
259+
257260
[workspace.lints.rust.future_incompatible]
258261
level = 'deny'
259262
priority = -1

clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# https://doc.rust-lang.org/nightly/clippy/lint_configuration.html
2+
23
cognitive-complexity-threshold = 200
34
excessive-nesting-threshold = 7
45
too-many-lines-threshold = 200

crates/bvh-region/Cargo.toml

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
1-
[package]
2-
name = "bvh-region"
3-
version = "0.1.0"
4-
edition = "2021"
5-
authors = ["Andrew Gazelka <andrew.gazelka@gmail.com>"]
6-
readme = "README.md"
7-
publish = false
1+
[[bench]]
2+
harness = false
3+
name = "sort"
84

9-
[features]
10-
plot = ["dep:plotters", "dep:plotters-bitmap"]
11-
default = []
5+
[[bench]]
6+
harness = false
7+
name = "bvh"
8+
9+
[[bench]]
10+
harness = false
11+
name = "side_by_side"
1212

1313
[dependencies]
14-
fastrand.workspace = true
15-
glam = { workspace = true, features = ["serde"] }
16-
rayon.workspace = true
14+
glam = {workspace = true, features = ["serde"]}
15+
plotters = {workspace = true, features = [
16+
"plotters-bitmap",
17+
"image"
18+
], optional = true}
19+
plotters-bitmap = {workspace = true, optional = true}
20+
serde = {workspace = true, features = ["derive"]}
1721
arrayvec.workspace = true
18-
ordered-float.workspace = true
22+
fastrand.workspace = true
1923
itertools.workspace = true
20-
plotters = { workspace = true, features = [
21-
"plotters-bitmap",
22-
"image",
23-
], optional = true }
24-
plotters-bitmap = { workspace = true, optional = true }
24+
ordered-float.workspace = true
25+
rayon.workspace = true
2526
tracing.workspace = true
26-
serde = { workspace = true, features = ["derive"] }
2727

2828
[dev-dependencies]
29-
divan.workspace = true
3029
criterion.workspace = true
30+
divan.workspace = true
3131
rand.workspace = true
3232
tango-bench.workspace = true
3333
tracing-subscriber.workspace = true
3434

35-
[[bench]]
36-
name = "sort"
37-
harness = false
38-
39-
[[bench]]
40-
name = "bvh"
41-
harness = false
42-
43-
[[bench]]
44-
name = "side_by_side"
45-
harness = false
35+
[features]
36+
default = []
37+
plot = ["dep:plotters", "dep:plotters-bitmap"]
4638

4739
[lints]
4840
workspace = true
41+
42+
[package]
43+
authors = ["Andrew Gazelka <andrew.gazelka@gmail.com>"]
44+
edition = "2021"
45+
name = "bvh-region"
46+
publish = false
47+
readme = "README.md"
48+
version = "0.1.0"

crates/hyperion-circle-buf/Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
[package]
2-
name = "hyperion-circle-buf"
3-
version = "0.1.0"
4-
edition = "2021"
5-
authors = ["Andrew Gazelka <andrew.gazelka@gmail.com>"]
6-
readme = "README.md"
7-
publish = false
8-
91
[dependencies]
102

113
[lints]
124
workspace = true
5+
6+
[package]
7+
authors = ["Andrew Gazelka <andrew.gazelka@gmail.com>"]
8+
edition = "2021"
9+
name = "hyperion-circle-buf"
10+
publish = false
11+
readme = "README.md"
12+
version = "0.1.0"

crates/hyperion-crafting/Cargo.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
[package]
2-
name = "hyperion-crafting"
3-
version = "0.1.0"
4-
edition = "2021"
5-
authors = ["Andrew Gazelka <andrew.gazelka@gmail.com>"]
6-
readme = "README.md"
7-
publish = false
8-
91
[dependencies]
10-
valence_protocol.workspace = true
112
anyhow.workspace = true
12-
flecs_ecs.workspace = true
133
derive-build.workspace = true
4+
flecs_ecs.workspace = true
145
slotmap.workspace = true
6+
valence_protocol.workspace = true
157

168
[lints]
179
workspace = true
10+
11+
[package]
12+
authors = ["Andrew Gazelka <andrew.gazelka@gmail.com>"]
13+
edition = "2021"
14+
name = "hyperion-crafting"
15+
publish = false
16+
readme = "README.md"
17+
version = "0.1.0"
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
[package]
2-
name = "hyperion-event-macros"
3-
version = "0.1.0"
4-
edition = "2021"
5-
authors = ["Andrew Gazelka <andrew.gazelka@gmail.com>"]
6-
readme = "README.md"
7-
publish = false
8-
9-
[lib]
10-
proc-macro = true
11-
121
[dependencies]
13-
quote = "1.0.37"
14-
syn = "2.0.79"
152
convert_case = "0.6.0"
163
proc-macro2 = "1.0.88"
4+
quote = "1.0.37"
5+
syn = "2.0.79"
176

187
[dev-dependencies]
198
trybuild = "1.0.100"
209
hyperion.workspace = true
2110

11+
[lib]
12+
proc-macro = true
13+
2214
[lints]
2315
workspace = true
16+
17+
[package]
18+
authors = ["Andrew Gazelka <andrew.gazelka@gmail.com>"]
19+
edition = "2021"
20+
name = "hyperion-event-macros"
21+
publish = false
22+
readme = "README.md"
23+
version = "0.1.0"

crates/hyperion-inventory/Cargo.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
[package]
2-
name = "hyperion-inventory"
3-
version = "0.1.0"
4-
edition = "2021"
5-
authors = ["Andrew Gazelka <andrew.gazelka@gmail.com>"]
6-
readme = "README.md"
7-
publish = false
8-
91
[dependencies]
10-
valence_protocol.workspace = true
112
flecs_ecs.workspace = true
12-
snafu.workspace = true
133
hyperion-crafting.workspace = true
144
roaring.workspace = true
5+
snafu.workspace = true
6+
valence_protocol.workspace = true
157

168
[lints]
179
workspace = true
10+
11+
[package]
12+
authors = ["Andrew Gazelka <andrew.gazelka@gmail.com>"]
13+
edition = "2021"
14+
name = "hyperion-inventory"
15+
publish = false
16+
readme = "README.md"
17+
version = "0.1.0"
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
[package]
2-
name = "hyperion-minecraft-proto"
3-
version = "0.1.0"
4-
edition = "2021"
5-
authors = ["Andrew Gazelka <andrew.gazelka@gmail.com>"]
6-
readme = "README.md"
7-
publish = false
8-
91
[dependencies]
102

113
[lints]
124
workspace = true
5+
6+
[package]
7+
authors = ["Andrew Gazelka <andrew.gazelka@gmail.com>"]
8+
edition = "2021"
9+
name = "hyperion-minecraft-proto"
10+
publish = false
11+
readme = "README.md"
12+
version = "0.1.0"

crates/hyperion-nerd-font/Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
[package]
2-
name = "hyperion-nerd-font"
3-
version = "0.1.0"
4-
edition = "2021"
5-
authors = ["Andrew Gazelka <andrew.gazelka@gmail.com>"]
6-
readme = "README.md"
7-
publish = false
8-
91
[dependencies]
102

113
[lints]
124
workspace = true
5+
6+
[package]
7+
authors = ["Andrew Gazelka <andrew.gazelka@gmail.com>"]
8+
edition = "2021"
9+
name = "hyperion-nerd-font"
10+
publish = false
11+
readme = "README.md"
12+
version = "0.1.0"

0 commit comments

Comments
 (0)