Skip to content

Commit

Permalink
Finalize lint setup
Browse files Browse the repository at this point in the history
  • Loading branch information
druzhinin-kirill committed Feb 26, 2024
1 parent 41d0e0e commit 04f7ced
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ repos:
- id: tox
name: tox
description: Run tox
entry: pdm run tox -e py
entry: pdm run tox -e py,lint
language: system
pass_filenames: false
14 changes: 14 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,26 @@ strict = true
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
disallow_incomplete_defs = false
disallow_untyped_calls = false

### Ruff ###

[tool.ruff]
line-length = 88

[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
"C90", # mccabe
"I", # isort
"PL", # pylint
"Q", # flake8-quotes
"RUF", # ruff
"E", # pycodestyle errors
"W", # pycodestyle warnings
]

[tool.ruff.lint.mccabe]
max-complexity = 10

Expand Down
1 change: 1 addition & 0 deletions src/dbt_score/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Init dbt_score package."""
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Test dbt_score package."""
8 changes: 5 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""Test configuration."""

from pytest import ExitCode, Session

def pytest_sessionfinish(session, exitstatus):

def pytest_sessionfinish(session: Session, exitstatus: int):
"""Avoid ci failure if no tests are found."""
if exitstatus == 5:
session.exitstatus = 0
if exitstatus == ExitCode.NO_TESTS_COLLECTED:
session.exitstatus = ExitCode.OK
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
env_list = py38,py39,py310,py311,lint,docs
env_list = py{38,39,310,311},lint,docs

skip_missing_interpreters = true

Expand All @@ -12,7 +12,7 @@ commands =

[testenv:lint]
description = Run lint
groups = lint
groups = lint, test
commands =
ruff check .
mypy .
Expand Down

0 comments on commit 04f7ced

Please sign in to comment.