flakeheaven._patched._checkers¶
- class flakeheaven._patched._checkers.FlakeHeavenCheckersManager(baseline: Optional[str], **kwargs)[source]¶
Bases:
flake8.checker.Manager
Patched flake8.checker.Manager to provide plugins support
Initialize our Manager instance.
- Parameters
style_guide (flake8.style_guide.StyleGuide) – The instantiated style guide for this instance of Flake8.
arguments (list) – The extra arguments parsed from the CLI (if any)
checker_plugins (flake8.plugins.manager.Checkers) – The plugins representing checks parsed from entry-points.
- _handle_results(filename: str, results: list, plugin_name: str, ignored_codes: Tuple[str, ...]) int [source]¶
- _should_process(argument: str, filename: str, check_type: str, check: Dict[str, Any]) bool [source]¶
- is_path_excluded(filename: str) bool [source]¶
Patched is_path_excluded.
We patch it to exclude files not specified explicitly. It is helpful when you want to run flakeheaven with –diff and explicitly passed paths at the same time.
Run flakeheaven only on changes in example.py:
git diff | flakeheaven lint –diff example.py
- class flakeheaven._patched._checkers.FlakeHeavenFileChecker(filename, checks, options)[source]¶
Bases:
flake8.checker.FileChecker
A little bit patched FileChecker to support –safe
Initialize our file checker.
- Parameters
filename (str) – Name of the file to check.
checks (dict) – The plugins registered to check the file.
options (argparse.Namespace) – Parsed option values from config and command-line.
- _make_processor() Optional[flakeheaven._patched._processor.FlakeHeavenProcessor] [source]¶
- _processed_plugin: str = 'pycodestyle'¶
- report(error_code: Optional[str], line_number: int, column: int, text: str) str [source]¶
Copy-pasted report method to store Result in self.results instead of tuple and provide plugin_name.
- run_checks() Tuple[str, List[flakeheaven._patched._checkers.Result], Dict[str, Any]] [source]¶
Run checks against the file.
- snapshot: flakeheaven._logic._snapshot.Snapshot¶
- class flakeheaven._patched._checkers.Result(plugin_name, error_code, line_number, column, text, line)[source]¶
Bases:
tuple
Create new instance of Result(plugin_name, error_code, line_number, column, text, line)
- _asdict()¶
Return a new OrderedDict which maps field names to their values.
- _field_defaults = {}¶
- _field_types = {'column': <class 'int'>, 'error_code': <class 'str'>, 'line': <class 'str'>, 'line_number': <class 'int'>, 'plugin_name': <class 'str'>, 'text': <class 'str'>}¶
- _fields = ('plugin_name', 'error_code', 'line_number', 'column', 'text', 'line')¶
- _fields_defaults = {}¶
- classmethod _make(iterable)¶
Make a new Result object from a sequence or iterable
- _replace(**kwds)¶
Return a new Result object replacing specified fields with new values
- property column¶
Alias for field number 3
- property error_code¶
Alias for field number 1
- property line¶
Alias for field number 5
- property line_number¶
Alias for field number 2
- property plugin_name¶
Alias for field number 0
- property text¶
Alias for field number 4