Add MacOS directory naming linting

A new Linter subclass - 'Directory' has been created and integrated into the linting process to handle directory naming conventions, specifically for MacOS. MacOS has issues when signing and notarizing directories with '.' in their names. The new class will trigger an 'Error' level diagnostic if this convention is violated. The linter will become a required check with this update, as its new check configuration was added to '.printer-linter'. The version number in 'pyproject.toml' was also incremented to reflect these changes.

Contributes to CURA-11014
This commit is contained in:
jellespijker 2023-09-22 01:29:22 +02:00
parent d5f4bffb8b
commit b401ecee02
5 changed files with 48 additions and 10 deletions

View file

@ -71,12 +71,16 @@ def main() -> None:
def diagnoseIssuesWithFile(file: Path, settings: dict) -> List[Diagnostic]:
""" For file, runs all diagnostic checks in settings and returns a list of diagnostics """
linter = factory.getLinter(file, settings)
linters = factory.getLinter(file, settings)
if not linter:
if not linters:
return []
return list(filter(lambda d: d is not None, linter.check()))
linter_results = []
for linter in linters:
linter_results.extend(list(filter(lambda d: d is not None, linter.check())))
return linter_results
def applyFixesToFile(file, settings, full_body_check) -> None: