Skip to content

Commit 380f335

Browse files
committed
Move PTB Config to using BaseConfig for excluded_paths
1 parent 252b606 commit 380f335

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

exasol/toolbox/config.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,14 @@ def excluded_paths(self) -> tuple[str, ...]:
8888
source_path, like excluding `dist`, `.eggs`. As such, this property is used to
8989
exclude such undesired paths.
9090
"""
91-
default_excluded_paths = {"dist", ".eggs", "venv", ".poetry"}
91+
default_excluded_paths = {
92+
"dist",
93+
".eggs",
94+
"venv",
95+
".poetry",
96+
".sonar",
97+
".html-documentation",
98+
}
9299
return tuple(default_excluded_paths.union(set(self.addition_to_excluded_paths)))
93100

94101
@computed_field # type: ignore[misc]

exasol/toolbox/nox/_shared.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,13 @@ def python_files(project_root: Path) -> Iterable[str]:
4444
"""
4545
Returns iterable of python files after removing unwanted paths
4646
"""
47-
deny_list = DEFAULT_PATH_FILTERS.union(set(PROJECT_CONFIG.path_filters))
48-
47+
check_for_config_attribute(config=PROJECT_CONFIG, attribute="excluded_paths")
4948
files = project_root.glob("**/*.py")
50-
return [f"{path}" for path in files if not set(path.parts).intersection(deny_list)]
49+
return [
50+
f"{path}"
51+
for path in files
52+
if not set(path.parts).intersection(PROJECT_CONFIG.excluded_paths)
53+
]
5154

5255

5356
def _version(session: Session, mode: Mode) -> None:

noxconfig.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,16 @@ class Config(BaseConfig):
5656
source: Path = Path("exasol/toolbox")
5757
importlinter: Path = Path(__file__).parent / ".import_linter_config"
5858
version_file: Path = Path(__file__).parent / "exasol" / "toolbox" / "version.py"
59-
path_filters: Iterable[str] = (
60-
"metrics-schema",
61-
"project-template",
62-
"idioms",
63-
".github",
64-
)
6559
plugins: Iterable[object] = (UpdateTemplates,)
6660

6761

6862
PROJECT_CONFIG = Config(
63+
addition_to_excluded_paths=(
64+
# The cookiecutter placeholders do not work well with checks.
65+
# Instead, the format & linting are checked in the
66+
# ``test.integration.project-template``.
67+
"project-template",
68+
),
6969
create_major_version_tags=True,
7070
# The PTB does not have integration tests run with an Exasol DB,
7171
# so for running in the CI, we take the first element.

0 commit comments

Comments
 (0)