mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-04 20:26:53 +00:00
Do not print the source when provided with -q
When users specify any number of -q's on the command-line, we should not show the source even if they have otherwwise configured Flake8 to do so. Closes #245
This commit is contained in:
parent
ca4f631fb2
commit
5dfb93c0d0
3 changed files with 74 additions and 0 deletions
|
|
@ -65,6 +65,10 @@ class FilenameOnly(SimpleFormatter):
|
|||
"""Initialize our set of filenames."""
|
||||
self.filenames_already_printed = set()
|
||||
|
||||
def show_source(self, error):
|
||||
"""Do not include the source code."""
|
||||
pass
|
||||
|
||||
def format(self, error):
|
||||
"""Ensure we only print each error once."""
|
||||
if error.filename not in self.filenames_already_printed:
|
||||
|
|
@ -78,3 +82,7 @@ class Nothing(base.BaseFormatter):
|
|||
def format(self, error):
|
||||
"""Do nothing."""
|
||||
pass
|
||||
|
||||
def show_source(self, error):
|
||||
"""Do not print the source."""
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue