diff options
| author | Anthony Sottile <asottile@umich.edu> | 2019-01-30 23:05:48 +0000 |
|---|---|---|
| committer | Anthony Sottile <asottile@umich.edu> | 2019-01-30 23:05:48 +0000 |
| commit | cbffa49a0ba6a6b31cd61fd8009da2c9bb8386fd (patch) | |
| tree | 99729a8aca7f9dc04827a7b245f8cd029e7f6ca7 /src/flake8 | |
| parent | e21d74fcc4dfbaf36aaa418215ad0615793f14fc (diff) | |
| parent | b0ecf3d28f200721968c8013d72c7e3215c2de70 (diff) | |
| download | flake8-cbffa49a0ba6a6b31cd61fd8009da2c9bb8386fd.tar.gz | |
Merge branch 'fix_statistics' into 'master'
Fix flake8 --statistics
Closes #499
See merge request pycqa/flake8!295
Diffstat (limited to 'src/flake8')
| -rw-r--r-- | src/flake8/style_guide.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/flake8/style_guide.py b/src/flake8/style_guide.py index df6409c..21a1185 100644 --- a/src/flake8/style_guide.py +++ b/src/flake8/style_guide.py @@ -337,7 +337,7 @@ class StyleGuideManager(object): self.decider = decider or DecisionEngine(options) self.style_guides = [] self.default_style_guide = StyleGuide( - options, formatter, decider=decider + options, formatter, self.stats, decider=decider ) self.style_guides = list( itertools.chain( @@ -436,14 +436,16 @@ class StyleGuideManager(object): class StyleGuide(object): """Manage a Flake8 user's style guide.""" - def __init__(self, options, formatter, filename=None, decider=None): + def __init__( + self, options, formatter, stats, filename=None, decider=None + ): """Initialize our StyleGuide. .. todo:: Add parameter documentation. """ self.options = options self.formatter = formatter - self.stats = statistics.Statistics() + self.stats = stats self.decider = decider or DecisionEngine(options) self.filename = filename if self.filename: @@ -459,7 +461,9 @@ class StyleGuide(object): filename = filename or self.filename options = copy.deepcopy(self.options) options.ignore.extend(extend_ignore_with or []) - return StyleGuide(options, self.formatter, filename=filename) + return StyleGuide( + options, self.formatter, self.stats, filename=filename + ) @contextlib.contextmanager def processing_file(self, filename): |
