summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2023-10-16 14:26:31 +0200
committerSanto Cariotti <santo@dcariotti.me>2023-10-16 14:29:52 +0200
commit450eabea277d0e582ed71f103c10ef7b0e5fa9f1 (patch)
tree815cd7e1cb30b79a378f69c85b18bb70386520f8
parent9df59059f0c1b3c123b1ae5be49e12418302ccea (diff)
Add pre-commit
-rw-r--r--.pre-commit-config.yaml11
-rw-r--r--src/main.rs1
2 files changed, 11 insertions, 1 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000..e61e810
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,11 @@
+---
+default_stages: [commit]
+
+repos:
+ - repo: https://github.com/doublify/pre-commit-rust
+ rev: master
+ hooks:
+ - id: fmt
+ - id: cargo-check
+ - id: clippy
+ args: []
diff --git a/src/main.rs b/src/main.rs
index 0656553..4452bf7 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -16,7 +16,6 @@ use trace::attach;
/// value and trace it.
fn main() -> anyhow::Result<()> {
let args = Args::parse();
-
let pid = if args.command.is_some() {
match fork() {
Ok(Fork::Child) => return exec(&args.command.unwrap()),