Created
December 29, 2017 12:00
-
-
Save timster/a6b8d01c864cf7ce7ad20ecb3f8d85b6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flake8.main.application import Application as Flake8 | |
from myproject.app import create_app | |
# Code in this module gets run every time the app restarts in debug mode. | |
# Therefore the linter runs every time the app restarts. | |
CYAN = '\x1b[1;36m' | |
RED = '\x1b[0;31m' | |
RESET = '\x1b[0m' | |
FORMAT = CYAN + '%(path)s ' + RESET + '%(row)d:%(col)d ' + RED + '%(text)s' + RESET | |
CONFIG = { | |
'DEBUG': True, | |
} | |
linter = Flake8() | |
linter.initialize(['myproject', '--format=' + FORMAT]) | |
linter.run_checks() | |
linter.report() | |
create_app(CONFIG).run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment