Skip to content

Commit

Permalink
Added linter and testing framework
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcTM01 committed Oct 14, 2024
1 parent 70bda15 commit a54e527
Show file tree
Hide file tree
Showing 4 changed files with 166 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: CI

on:
push:
branches:
- '**'

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PDM
uses: pdm-project/setup-pdm@v4

- name: Install dependencies
run: pdm install

- name: Check formatting
run: pdm run ruff format --check

- name: Check linting
if: always()
run: pdm run ruff check

- name: Run tests
if: always()
run: pdm run test

- name: Run doctests
if: always()
run: pdm run doctest
102 changes: 102 additions & 0 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 30 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,35 @@ license = {text = "AGPL-3.0-only"}
requires = ["pdm-backend"]
build-backend = "pdm.backend"


[tool.pdm]
distribution = true

[tool.pdm.scripts]
lint = "ruff check --fix ."
format = "ruff format ."
test = "pytest tests/"
doctest = "pytest --doctest-modules --doctest-continue-on-failure src/"

[tool.pdm.dev-dependencies]
linting = [
"ruff>=0.6.9",
]
testing = [
"pytest>=8.3.3",
]

[tool.ruff]
line-length = 120

[tool.ruff.lint]
preview = true
select = ["F", "E", "W", "I", "N", "D", "UP", "ASYNC", "BLE", "B", "A", "COM", "C4",
"DTZ", "DJ", "EM", "FA", "ISC", "LOG", "G", "PIE", "T20", "PT", "Q", "RSE", "RET", "SIM",
"TID", "TCH", "INT", "ARG", "PTH", "PD", "PL", "TRY", "FLY", "NPY", "PERF", "FURB", "RUF", "ANN"]
ignore = ["ISC001", "COM812", "DTZ001", "RET504", "D100"]

[tool.ruff.lint.per-file-ignores]
"**/tests/**" = ["D", "PLR2004"]

[tool.ruff.lint.pydocstyle]
convention = "google"
1 change: 1 addition & 0 deletions src/dataland_qa_lab/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""The Dataland Quality Assurance Lab package."""

0 comments on commit a54e527

Please sign in to comment.