Skip to content

Commit

Permalink
lint: add ruff and github action for linting
Browse files Browse the repository at this point in the history
  • Loading branch information
robvdl committed Mar 6, 2024
1 parent 3ac43a0 commit c3c40d7
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: CI

on: push

jobs:
lint:
name: Lint
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Run Ruff over code
uses: chartboost/ruff-action@v1
33 changes: 33 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ test = [
"pytest==8.0.2",
"pytest-cov==4.1.0",
"WebTest==3.0.0",
"ruff==0.3.0",
]

[project.license]
Expand Down Expand Up @@ -64,3 +65,35 @@ universal = true
[tool.pytest.ini_options]
python_files = ["tests.py", "test_*.py", "*_tests.py"]
addopts = "--cov=sambal --cov-branch --cov-report=term --cov-report=html:reports/htmlcov --cov-report=xml:reports/coverage.xml --junitxml=reports/junit.xml"

[tool.ruff]
exclude = [
".coverage",
".eggs",
".git",
".git-rewrite",
".ruff_cache",
".tox",
".vscode",
"build",
"dist",
"venv",
]
line-length = 88
indent-width = 4
target-version = "py38"

[tool.ruff.lint]
select = ["E4", "E7", "E9", "F"]
ignore = []
fixable = ["ALL"]
unfixable = []
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
docstring-code-format = false
docstring-code-line-length = "dynamic"
4 changes: 4 additions & 0 deletions src/sambal/forms/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
from .login import LoginForm

__all__ = (
"LoginForm",
)
4 changes: 4 additions & 0 deletions src/sambal/tweens/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
from .headers import SecurityHeaders

__all__ = (
"SecurityHeaders",
)

0 comments on commit c3c40d7

Please sign in to comment.