flakeheaven._patched._style_guide

class flakeheaven._patched._style_guide.FlakeHeavenStyleGuide(options: argparse.Namespace, formatter: flake8.formatting.base.BaseFormatter, stats: flake8.statistics.Statistics, filename: Optional[str] = None, decider: Optional[flake8.style_guide.DecisionEngine] = None)[source]

Bases: flake8.style_guide.StyleGuide

Initialize our StyleGuide.

Todo

Add parameter documentation.

handle_error(code: str, filename: str, line_number: int, column_number: int, text: str, plugin: str, physical_line: Optional[str] = None)[source]

This function copied as is, but: 1. Violation is replaced by FlakeHeavenViolation 2. error_is_selected dropped. If we get here, the error IS selected.

class flakeheaven._patched._style_guide.FlakeHeavenStyleGuideManager(options, formatter, decider=None)[source]

Bases: flake8.style_guide.StyleGuideManager

Initialize our StyleGuide.

Todo

Add parameter documentation.

__init__(options, formatter, decider=None)[source]

Initialize our StyleGuide.

Todo

Add parameter documentation.

handle_error(code: str, filename: str, line_number: int, column_number: int, text: str, plugin: str, physical_line: Optional[str] = None)[source]

Handle an error reported by a check.

Parameters
  • code (str) – The error code found, e.g., E123.

  • filename (str) – The file in which the error was found.

  • line_number (int) – The line number (where counting starts at 1) at which the error occurs.

  • column_number (int) – The column number (where counting starts at 1) at which the error occurs.

  • text (str) – The text of the error message.

  • physical_line (str) – The actual physical line causing the error.

Returns

1 if the error was reported. 0 if it was ignored. This is to allow for counting of the number of errors found that were not ignored.

Return type

int

style_guide_for(filename: str)[source]

Patched styleguide finder to give priority to flakeheaven’s stileguides