Skip to content

Commit f31954b

Browse files
committed
Fix linting/testing - move pylint config to pyproject.toml
1 parent 6645491 commit f31954b

4 files changed

Lines changed: 35 additions & 14 deletions

File tree

.pre-commit-config.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ repos:
4343
rev: v3.3.4
4444
hooks:
4545
- id: pylint
46-
args:
47-
- --rcfile=.pylintrc
4846
additional_dependencies:
4947
- "cairosvg"
5048
- "click"

.pylintrc

Lines changed: 0 additions & 12 deletions
This file was deleted.

pyproject.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,17 @@ addopts = "-v --cov=pdfbaker --cov-report=term-missing"
4343

4444
[tool.coverage.run]
4545
source = ["pdfbaker"]
46+
47+
[tool.pylint.main]
48+
py-version = "3.11"
49+
ignore-paths = ["tests/"]
50+
init-hook = "import sys; sys.path.insert(0, 'src')"
51+
52+
[tool.pylint.messages_control]
53+
disable = ["W0511"] # Disable TODO/FIXME warnings
54+
55+
[tool.pylint.reports]
56+
msg-template = "{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}"
57+
output-format = "colorized"
58+
reports = "no"
59+
score = "no"

tests/conftest.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"""Common configuration of tests."""
2+
3+
from pathlib import Path
4+
5+
import pytest
6+
7+
from pdfbaker.config import Directories
8+
9+
10+
@pytest.fixture
11+
def default_directories(tmp_path: Path) -> Directories:
12+
"""Fixture providing default Directories for tests."""
13+
return Directories(
14+
base=tmp_path,
15+
build=tmp_path / "build",
16+
dist=tmp_path / "dist",
17+
documents=tmp_path / "documents",
18+
pages=tmp_path / "pages",
19+
templates=tmp_path / "templates",
20+
images=tmp_path / "images",
21+
)

0 commit comments

Comments
 (0)