Skip to content

Commit 8c91269

Browse files
authored
add precommit which runs fmt
1 parent e0f3f19 commit 8c91269

3 files changed

Lines changed: 39 additions & 2 deletions

File tree

Cargo.lock

Lines changed: 27 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2018"
66
description = "A python interpreter written in rust."
77
repository = "https://github.com/RustPython/RustPython"
88
license = "MIT"
9-
include = ["LICENSE", "Cargo.toml", "src/**/*.rs"]
9+
include = ["LICENSE", "build.rs", "Cargo.toml", "src/**/*.rs"]
1010

1111
[workspace]
1212
resolver = "2"
@@ -45,11 +45,19 @@ flamescope = { version = "0.1", optional = true }
4545
[target.'cfg(not(target_os = "wasi"))'.dependencies]
4646
rustyline = "9"
4747

48+
49+
[target.'cfg(not(target_os = "windows"))'.build-dependencies]
50+
pre-commit = "0.5.2"
51+
4852
[dev-dependencies]
4953
cpython = "0.6"
5054
python3-sys = "0.6"
5155
criterion = "0.3"
5256

57+
[package.metadata.precommit]
58+
fmt = "cargo fmt --all"
59+
git-add = "git add -u"
60+
5361
[[bench]]
5462
name = "execution"
5563
harness = false

build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
// build script to run pre-commit build script
3+
}

0 commit comments

Comments
 (0)