Skip to content

Commit 19b2739

Browse files
authored
chore: stop warnings from being raised from our custom linter (#2284)
1 parent d8bebb4 commit 19b2739

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

scripts/custom_checks/docstr_examples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,5 @@ def fix_single_file(path: Path) -> str | None:
8080
return "\n".join(was_fixed)
8181

8282

83-
def format_docstring_examples(files: list[Path]) -> str:
83+
def format_docstring_examples(files: tuple[Path, ...]) -> str:
8484
return "\n".join(filter(None, map(fix_single_file, files)))

scripts/custom_checks/docstrings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ def format_docstring_function(fn) -> list[str]:
425425
return []
426426

427427

428-
def find_all_classes_and_funcs(files: list[Path]):
428+
def find_all_classes_and_funcs(files: tuple[Path, ...]):
429429
def predicate(obj):
430430
return inspect.isclass(obj) or inspect.isfunction(obj)
431431

@@ -438,5 +438,5 @@ def predicate(obj):
438438
}
439439

440440

441-
def format_docstrings(files: list[Path]) -> str:
441+
def format_docstrings(files: tuple[Path, ...]) -> str:
442442
return "\n".join(itertools.chain.from_iterable(map(format_docstring, find_all_classes_and_funcs(files))))

scripts/run_checks.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import sys
44
from pathlib import Path
55

6+
from cognite.client import global_config
67
from scripts.custom_checks.docstr_examples import format_docstring_examples
78
from scripts.custom_checks.docstrings import format_docstrings
89
from scripts.custom_checks.version import (
@@ -12,8 +13,10 @@
1213
version_number_and_date_is_increasing,
1314
)
1415

16+
global_config.silence_feature_preview_warnings = True
1517

16-
def run_checks(files: list[Path]) -> list[str | None]:
18+
19+
def run_checks(files: tuple[Path, ...]) -> list[str | None]:
1720
return [
1821
pyproj_version_matches(),
1922
changelog_entry_version_matches(),

0 commit comments

Comments
 (0)