Skip to content

Commit e1847c1

Browse files
authored
Merge pull request #42 from influxdata/crepererum/more-just
chore: extend `Justfile` with some helpful dev tasks
2 parents ffcaa7c + 742e6c7 commit e1847c1

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed

CONTRIBUTING.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,18 @@ There is one "run everything" [just] recipe:
3030
just check
3131
```
3232

33+
Some common issues can be auto-fixed by running:
34+
35+
```console
36+
just fix
37+
```
38+
3339
If this doesn't work, see ["Troubleshooting"](#troubleshooting).
3440

3541
To list all recipes that are available, run:
3642

3743
```console
38-
just --list --list-submodules
44+
just
3945
```
4046

4147
## CI

Justfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
mod guests
22

3+
# default Just target - list recipes
4+
default:
5+
@just --list --list-submodules
6+
37
# check Rust files via `cargo build`
48
check-rust-build: guests::rust::check-build guests::python::check-build
59

@@ -56,3 +60,36 @@ check-yaml:
5660

5761
# run ALL checks
5862
check: check-rust check-yaml
63+
64+
# clean Rust build artifacts
65+
clean-rust:
66+
@echo ::group::clean-rust
67+
cargo clean
68+
@echo ::endgroup::
69+
70+
# clean build artifacts
71+
clean: clean-rust guests::python::clean
72+
73+
# fix Rust check/rustc warnings
74+
fix-rust-check:
75+
@echo ::group::fix-rust-check
76+
cargo fix --workspace --allow-dirty --allow-staged
77+
@echo ::endgroup::
78+
79+
# fix Rust clippy warnings
80+
fix-rust-clippy:
81+
@echo ::group::fix-rust-clippy
82+
cargo clippy --all-targets --all-features --workspace --fix --allow-dirty --allow-staged
83+
@echo ::endgroup::
84+
85+
# fix Rust formatting
86+
fix-rust-fmt:
87+
@echo ::group::fix-rust-fmt
88+
cargo fmt --all
89+
@echo ::endgroup::
90+
91+
# fix common Rust issues automatically
92+
fix-rust: fix-rust-clippy fix-rust-check fix-rust-fmt
93+
94+
# fix common issues automatically
95+
fix: fix-rust

guests/python/Justfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,9 @@ release: (do "release")
128128

129129
# checks build
130130
check-build: debug
131+
132+
# clean build artifacts
133+
clean:
134+
@echo ::group::guests::python::clean
135+
rm -rf {{DOWNLOADS_DIR}}
136+
@echo ::endgroup::

0 commit comments

Comments
 (0)