From 869d1c9d31ac8647c5eb42ddcbdea65db8387c99 Mon Sep 17 00:00:00 2001 From: Marvin Vogt Date: Sun, 15 Sep 2024 11:02:07 +0000 Subject: [PATCH 1/2] Add just recipe to lint justfile --- justfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/justfile b/justfile index 5a30369..267caa9 100644 --- a/justfile +++ b/justfile @@ -6,11 +6,14 @@ default: check-lockfile lint type-check test check-lockfile: uv lock --locked -# Lint code and check formatting using ruff -lint +dirs="src tests": +# Lint code and check formatting +lint +dirs="src tests": lint-justfile uv run ruff check {{ dirs }} uv run ruff format --check {{ dirs }} +lint-justfile: + just --check --fmt --unstable + # Validate static types using mypy type-check +dirs="src": uv run mypy {{ dirs }} From 682587ecf4748029b999b9f51e731403fe4c47a9 Mon Sep 17 00:00:00 2001 From: Marvin Vogt Date: Sun, 15 Sep 2024 11:03:51 +0000 Subject: [PATCH 2/2] Format justfile --- justfile | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/justfile b/justfile index 267caa9..9d0d839 100644 --- a/justfile +++ b/justfile @@ -4,29 +4,29 @@ default: check-lockfile lint type-check test # Check if the lockfile is up to date check-lockfile: - uv lock --locked + uv lock --locked # Lint code and check formatting lint +dirs="src tests": lint-justfile - uv run ruff check {{ dirs }} - uv run ruff format --check {{ dirs }} + uv run ruff check {{ dirs }} + uv run ruff format --check {{ dirs }} lint-justfile: - just --check --fmt --unstable + just --check --fmt --unstable # Validate static types using mypy type-check +dirs="src": - uv run mypy {{ dirs }} + uv run mypy {{ dirs }} # Run tests using pytest test $COV=env("CI", "false") $FRR_VERSION=FRR_LATEST_MAJOR_VERSION: - #!/usr/bin/env bash - set -euxo pipefail + #!/usr/bin/env bash + set -euxo pipefail - args=() - ( $COV == "true" ) && args+=( "--cov" ) - uv run pytest tests ${args[@]} + args=() + ( $COV == "true" ) && args+=( "--cov" ) + uv run pytest tests ${args[@]} - if [ $COV = "true" ]; then - uv run coverage xml - fi + if [ $COV = "true" ]; then + uv run coverage xml + fi