diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml new file mode 100644 index 0000000..1953ea5 --- /dev/null +++ b/.github/workflows/qa.yml @@ -0,0 +1,31 @@ +name: qa + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: true + virtualenvs-in-project: true + + - name: Install dependencies + run: poetry install --no-interaction + + - name: Lint + run: poetry run ruff check . diff --git a/Makefile b/Makefile index d006704..95b027b 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,16 @@ dev-push: @git commit -m "$$(read -p 'Commit message: ' msg; echo $$msg)" || true @git push +## ================== +## Quality Assurance +## ================== + +.PHONY: lint + +lint: + @echo "Running ruff linter..." + @poetry run ruff check . + ## ================ ## Release Commands ## ================ diff --git a/pyproject.toml b/pyproject.toml index 873a0b6..ccb5cbc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,10 +12,18 @@ httpx = "^0.24.0" [tool.poetry.group.dev.dependencies] pytest = "^8.0" +ruff = "^0.4" [tool.pytest.ini_options] testpaths = ["tests"] +[tool.ruff] +line-length = 120 +target-version = "py310" + +[tool.ruff.lint] +select = ["E", "F", "W", "I"] + [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api"