Skip to content

Commit 750f758

Browse files
committed
chore: More justfile minor updates
1 parent cb42549 commit 750f758

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

justfile

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ src-dir := 'src' / app-id
1111
test-dir := 'tests'
1212
docs-dir := 'docs'
1313

14+
python-ver := 'py312'
1415
rtd-build-api-url := "https://readthedocs.org/api/v3/projects/{{app-id}}/versions/latest/builds/"
1516

1617
# Show this help and exit.
@@ -33,17 +34,17 @@ clean:
3334
# Set local development environment with nix and direnv.
3435
dev:
3536
#!/usr/bin/env bash
36-
if command -v nix-env > /dev/null && command -v direnv > /dev/null; then \
37+
if command -v nix-env > /dev/null && command -v direnv > /dev/null; then
3738
printf "Configuring a local dev environment and setting up git pre-commit hooks...\n" >&2 \
3839
&& direnv allow . > /dev/null \
3940
&& DIRENV_LOG_FORMAT="" direnv exec {{justfile_directory()}} pre-commit install \
40-
&& printf "Done.\n" >&2; \
41-
elif command -v nix-env > /dev/null; then \
42-
printf "Error: direnv seems to be unconfigured or missing\n" >&2 && exit 1; \
43-
elif command -v direnv > /dev/null; then \
44-
printf "Error: nix seems to be unconfigured or missing\n" >&2 && exit 1; \
45-
else \
46-
printf "Error: both direnv and nix seem to be unconfigured and/or missing" >&2 && exit 1; \
41+
&& printf "Done.\n" >&2
42+
elif command -v nix-env > /dev/null; then
43+
printf "Error: direnv seems to be unconfigured or missing\n" >&2 && exit 1
44+
elif command -v direnv > /dev/null; then
45+
printf "Error: nix seems to be unconfigured or missing\n" >&2 && exit 1
46+
else
47+
printf "Error: both direnv and nix seem to be unconfigured and/or missing" >&2 && exit 1
4748
fi
4849

4950
# Reset local development environment.
@@ -69,7 +70,7 @@ docs-html-serve:
6970
# Reorder imports with ruff then apply black.
7071
fmt:
7172
ruff check --fix
72-
black -t py312 {{src-dir}} {{test-dir}}
73+
black -t {{python-ver}} {{src-dir}} {{test-dir}}
7374

7475
# Build a docker image and load it into a running daemon.
7576
img:
@@ -86,7 +87,7 @@ lint-types:
8687
# Lint style conventions.
8788
lint-style:
8889
ruff check
89-
black -t py312 --check {{src-dir}} {{test-dir}}
90+
black -t {{python-ver}} --check {{src-dir}} {{test-dir}}
9091

9192
# Lint various metrics.
9293
lint-metrics:

0 commit comments

Comments
 (0)