Skip to content

Commit

Permalink
Change lint workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Kutu committed Jun 1, 2024
1 parent 08bbeac commit d500a14
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/lint.yml → .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint and format
name: Linting and formatting

on:
push:
Expand All @@ -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/[email protected]
- run: just setup
- run: just check
22 changes: 15 additions & 7 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d500a14

Please sign in to comment.