mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-29 10:36:53 +00:00
Merge pull request #1721 from PyCQA/itertools-chain
replace some unnecessary itertools.chain with *splat
This commit is contained in:
commit
7dfe99616f
2 changed files with 5 additions and 11 deletions
|
|
@ -4,7 +4,6 @@ from __future__ import annotations
|
|||
import argparse
|
||||
import collections
|
||||
import errno
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing.pool
|
||||
import signal
|
||||
|
|
@ -80,9 +79,7 @@ class Manager:
|
|||
"physical lines": 0,
|
||||
"tokens": 0,
|
||||
}
|
||||
self.exclude = tuple(
|
||||
itertools.chain(self.options.exclude, self.options.extend_exclude)
|
||||
)
|
||||
self.exclude = (*self.options.exclude, *self.options.extend_exclude)
|
||||
|
||||
def _process_statistics(self) -> None:
|
||||
for checker in self.checkers:
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import contextlib
|
|||
import copy
|
||||
import enum
|
||||
import functools
|
||||
import itertools
|
||||
import logging
|
||||
from typing import Generator
|
||||
from typing import Sequence
|
||||
|
|
@ -221,12 +220,10 @@ class StyleGuideManager:
|
|||
self.default_style_guide = StyleGuide(
|
||||
options, formatter, self.stats, decider=decider
|
||||
)
|
||||
self.style_guides = list(
|
||||
itertools.chain(
|
||||
[self.default_style_guide],
|
||||
self.populate_style_guides_with(options),
|
||||
)
|
||||
)
|
||||
self.style_guides = [
|
||||
self.default_style_guide,
|
||||
*self.populate_style_guides_with(options),
|
||||
]
|
||||
|
||||
self.style_guide_for = functools.lru_cache(maxsize=None)(
|
||||
self._style_guide_for
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue