Cura/printer-linter/src/printerlinter/linters/linter.py
Joey de l'Arago e83ed933e2 Update readme with instruction for developing.
Change DiagnosticGenerator -> Linter since this is much easier to understand.
2022-11-23 17:52:33 +01:00

20 lines
No EOL
620 B
Python

from abc import ABC, abstractmethod
from pathlib import Path
from typing import Iterator
from ..diagnostic import Diagnostic
class Linter(ABC):
def __init__(self, file: Path, settings: dict) -> None:
""" Yields Diagnostics for file, these are issues with the file such as bad text format or too large file size.
@param file: A file to generate diagnostics for
@param settings: A list of settings containing rules for creating diagnostics
"""
self._settings = settings
self._file = file
@abstractmethod
def check(self) -> Iterator[Diagnostic]:
pass