Skip to content

Instantly share code, notes, and snippets.

@AlexArcPy
Created January 8, 2019 20:50
Show Gist options
  • Save AlexArcPy/d8da28d4ca95a381435f301323e639b1 to your computer and use it in GitHub Desktop.
Save AlexArcPy/d8da28d4ca95a381435f301323e639b1 to your computer and use it in GitHub Desktop.
Exploring flake8 api
from flake8.api import legacy as flake8
style_guide = flake8.get_style_guide()
style_guide.check_files([r"C:\Development\code_for_flake8_to_analyze.py"])
checker = style_guide._file_checker_manager.checkers[0]
tokens = checker.processor.file_tokens
Using wemakeservices linter
C:\Development\code_for_flake8_to_analyze.py:0:1: C101 Coding magic comment not found
C:\Development\code_for_flake8_to_analyze.py:1:1: Z110 Found wrong variable name "some"
C:\Development\code_for_flake8_to_analyze.py:1:1: D100 Missing docstring in public module
C:\Development\code_for_flake8_to_analyze.py:1:1: D103 Missing docstring in public function
C:\Development\code_for_flake8_to_analyze.py:2:1: I001 isort found an import in the wrong position
C:\Development\code_for_flake8_to_analyze.py:2:5: T001 print found.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment