diff options
| author | Ian Cordasco <graffatcolmingov@gmail.com> | 2016-11-11 19:06:13 -0600 |
|---|---|---|
| committer | Ian Cordasco <graffatcolmingov@gmail.com> | 2016-11-11 19:06:13 -0600 |
| commit | 5dfb93c0d0ee4d6e14d959ab7d6bd390b98e59c0 (patch) | |
| tree | 4ad71b7d605eed0f256fc16b28f2603c97fcf1b4 /src/flake8 | |
| parent | ca4f631fb2411d6f9fbf73ed10275ba8d19dd278 (diff) | |
| download | flake8-5dfb93c0d0ee4d6e14d959ab7d6bd390b98e59c0.tar.gz | |
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
Diffstat (limited to 'src/flake8')
| -rw-r--r-- | src/flake8/formatting/default.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/flake8/formatting/default.py b/src/flake8/formatting/default.py index f8e3a66..8c91f9f 100644 --- a/src/flake8/formatting/default.py +++ b/src/flake8/formatting/default.py @@ -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 |
