Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add just recipe to lint justfile and fix formatting #114

Merged
merged 2 commits into from
Sep 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +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 using ruff
lint +dirs="src tests":
uv run ruff check {{ dirs }}
uv run ruff format --check {{ dirs }}
# 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 }}
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