diff --git a/.github/workflows/lint.yml b/.github/workflows/check.yml similarity index 67% rename from .github/workflows/lint.yml rename to .github/workflows/check.yml index cdd7b85..c47b105 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/check.yml @@ -1,4 +1,4 @@ -name: Lint and format +name: Linting and formatting on: push: @@ -11,8 +11,10 @@ jobs: runs-on: ubuntu-latest steps: + - run: sudo apt-get install -y just - uses: actions/checkout@v3 - uses: actions/setup-python@v3 with: python-version: "3.11.0" - - uses: pre-commit/action@v3.0.0 + - run: just setup + - run: just check diff --git a/justfile b/justfile index 92a9323..4d2d698 100644 --- a/justfile +++ b/justfile @@ -6,22 +6,26 @@ help: # Setup the Python venv for development setup: - rm -r .venv + rm -rf .venv python3 -m venv .venv .venv/bin/pip install --upgrade pip .venv/bin/pip install -r requirements/requirements.txt # Check if the project is following the guidelines check: - mypy src/knuckles - mypy tests - ruff check --fix - ruff format + .venv/bin/mypy src/knuckles + .venv/bin/mypy tests + .venv/bin/ruff check --fix + .venv/bin/ruff format -install-hook: - rm .git/hooks/pre-commit +# Install a pre-commit hook to ensure that the CI will pass +install-hook: uninstall-hook cp scripts/pre-commit.sh .git/hooks/pre-commit +# Uninstall the pre-commit hook +uninstall-hook: + rm -f .git/hooks/pre-commit + # Spin up a local documentation of the project docs: .venv/bin/mkdocs serve @@ -33,6 +37,10 @@ test: # Generate a new lock file for all the deps lock: lock-dev-deps lock-docs-deps lock-tests-deps +[private] +deploy-docs: + .venv/bin/mkdocs gh-deploy --force + [private] lock-dev-deps: .venv/bin/pip-compile --extra=dev --output-file=requirements/requirements-dev.txt pyproject.toml