|
10 | 10 | import tomlkit |
11 | 11 | from nox import Session |
12 | 12 |
|
13 | | -from exasol.toolbox.nox._shared import python_files |
| 13 | +from exasol.toolbox.nox._shared import get_filtered_python_files |
14 | 14 | from exasol.toolbox.util.dependencies.shared_models import PoetryFiles |
15 | 15 | from noxconfig import PROJECT_CONFIG |
16 | 16 |
|
17 | 17 |
|
18 | 18 | def _pylint(session: Session, files: Iterable[str]) -> None: |
| 19 | + json_file = PROJECT_CONFIG.root / ".lint.json" |
| 20 | + txt_file = PROJECT_CONFIG.root / ".lint.txt" |
| 21 | + |
19 | 22 | session.run( |
20 | 23 | "pylint", |
21 | 24 | "--output-format", |
22 | | - "colorized,json:.lint.json,text:.lint.txt", |
| 25 | + f"colorized,json:{json_file},text:{txt_file}", |
23 | 26 | *files, |
24 | 27 | ) |
25 | 28 |
|
@@ -47,7 +50,7 @@ def _security_lint(session: Session, files: Iterable[str]) -> None: |
47 | 50 | "--format", |
48 | 51 | "json", |
49 | 52 | "--output", |
50 | | - ".security.json", |
| 53 | + PROJECT_CONFIG.root / ".security.json", |
51 | 54 | "--exit-zero", |
52 | 55 | *files, |
53 | 56 | ) |
@@ -120,22 +123,22 @@ def report_illegal(illegal: dict[str, list[str]], console: rich.console.Console) |
120 | 123 | @nox.session(name="lint:code", python=False) |
121 | 124 | def lint(session: Session) -> None: |
122 | 125 | """Runs the static code analyzer on the project""" |
123 | | - py_files = python_files(PROJECT_CONFIG.root / PROJECT_CONFIG.source) |
124 | | - _pylint(session, py_files) |
| 126 | + py_files = get_filtered_python_files(PROJECT_CONFIG.root / PROJECT_CONFIG.source) |
| 127 | + _pylint(session=session, files=py_files) |
125 | 128 |
|
126 | 129 |
|
127 | 130 | @nox.session(name="lint:typing", python=False) |
128 | 131 | def type_check(session: Session) -> None: |
129 | 132 | """Runs the type checker on the project""" |
130 | | - py_files = [f"{file}" for file in python_files(PROJECT_CONFIG.root)] |
131 | | - _type_check(session, py_files) |
| 133 | + py_files = get_filtered_python_files(PROJECT_CONFIG.root) |
| 134 | + _type_check(session=session, files=py_files) |
132 | 135 |
|
133 | 136 |
|
134 | 137 | @nox.session(name="lint:security", python=False) |
135 | 138 | def security_lint(session: Session) -> None: |
136 | 139 | """Runs the security linter on the project""" |
137 | | - py_files = python_files(PROJECT_CONFIG.root / PROJECT_CONFIG.source) |
138 | | - _security_lint(session, py_files) |
| 140 | + py_files = get_filtered_python_files(PROJECT_CONFIG.root / PROJECT_CONFIG.source) |
| 141 | + _security_lint(session=session, files=py_files) |
139 | 142 |
|
140 | 143 |
|
141 | 144 | @nox.session(name="lint:dependencies", python=False) |
|
0 commit comments