diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 253e27166..938530113 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,7 +43,7 @@ repos: hooks: - id: isort - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: 'v0.0.238' + rev: 'v0.0.247' hooks: - id: ruff - repo: https://github.com/codespell-project/codespell diff --git a/dvc/cli/__init__.py b/dvc/cli/__init__.py index d1f893d9a..e5bc06749 100644 --- a/dvc/cli/__init__.py +++ b/dvc/cli/__init__.py @@ -146,7 +146,7 @@ def _log_exceptions(exc: Exception) -> Optional[int]: return None -def main(argv=None): # noqa: C901 +def main(argv=None): # noqa: C901, PLR0912, PLR0915 """Main entry point for dvc CLI. Args: @@ -172,7 +172,7 @@ def main(argv=None): # noqa: C901 args = None - outerLogLevel = logger.level + outer_log_level = logger.level try: args = parse_args(argv) @@ -243,7 +243,7 @@ def main(argv=None): # noqa: C901 return ret finally: - logger.setLevel(outerLogLevel) + logger.setLevel(outer_log_level) from dvc.external_repo import clean_repos diff --git a/dvc/commands/dag.py b/dvc/commands/dag.py index 6bf7b8722..ae9dcdc62 100644 --- a/dvc/commands/dag.py +++ b/dvc/commands/dag.py @@ -9,11 +9,11 @@ if TYPE_CHECKING: from networkx import DiGraph -def _show_ascii(G: "DiGraph"): +def _show_ascii(graph: "DiGraph"): from dvc.dagascii import draw from dvc.repo.graph import get_pipelines - pipelines = get_pipelines(G) + pipelines = get_pipelines(graph) ret = [] for pipeline in pipelines: @@ -31,7 +31,7 @@ def _quote_label(node): return label -def _show_dot(G: "DiGraph"): +def _show_dot(graph: "DiGraph"): import io import networkx as nx @@ -39,15 +39,15 @@ def _show_dot(G: "DiGraph"): dot_file = io.StringIO() - nx.relabel_nodes(G, _quote_label, copy=False) - write_dot(G.reverse(), dot_file) + nx.relabel_nodes(graph, _quote_label, copy=False) + write_dot(graph.reverse(), dot_file) return dot_file.getvalue() -def _show_mermaid(G, markdown: bool = False): +def _show_mermaid(graph, markdown: bool = False): from dvc.repo.graph import get_pipelines - pipelines = get_pipelines(G) + pipelines = get_pipelines(graph) graph = "flowchart TD" @@ -100,43 +100,42 @@ def _transform(index, outs): def _relabel(node) -> str: return node.addressing if isinstance(node, Stage) else str(node) - G = index.outs_graph if outs else index.graph - return nx.relabel_nodes(G, _relabel, copy=True) + graph = index.outs_graph if outs else index.graph + return nx.relabel_nodes(graph, _relabel, copy=True) -def _filter(G, targets, full): +def _filter(graph, targets, full): import networkx as nx if not targets: - return G + return graph - H = G.copy() + new_graph = graph.copy() if not full: descendants = set() for target in targets: - descendants.update(nx.descendants(G, target)) + descendants.update(nx.descendants(graph, target)) descendants.add(target) - H.remove_nodes_from(set(G.nodes()) - descendants) + new_graph.remove_nodes_from(set(graph.nodes()) - descendants) - undirected = H.to_undirected() + undirected = new_graph.to_undirected() connected = set() for target in targets: connected.update(nx.node_connected_component(undirected, target)) - H.remove_nodes_from(set(H.nodes()) - connected) - - return H + new_graph.remove_nodes_from(set(new_graph.nodes()) - connected) + return new_graph def _build(repo, target=None, full=False, outs=False): targets = _collect_targets(repo, target, outs) - G = _transform(repo.index, outs) - return _filter(G, targets, full) + graph = _transform(repo.index, outs) + return _filter(graph, targets, full) class CmdDAG(CmdBase): def run(self): - G = _build( + graph = _build( self.repo, target=self.args.target, full=self.args.full, @@ -144,12 +143,12 @@ class CmdDAG(CmdBase): ) if self.args.dot: - ui.write(_show_dot(G)) + ui.write(_show_dot(graph)) elif self.args.mermaid or self.args.markdown: - ui.write(_show_mermaid(G, self.args.markdown)) + ui.write(_show_mermaid(graph, self.args.markdown)) else: with ui.pager(): - ui.write(_show_ascii(G)) + ui.write(_show_ascii(graph)) return 0 diff --git a/dvc/commands/experiments/show.py b/dvc/commands/experiments/show.py index 43e72d01a..b85d63ff0 100644 --- a/dvc/commands/experiments/show.py +++ b/dvc/commands/experiments/show.py @@ -62,7 +62,7 @@ experiment_types = { } -def _collect_rows( # noqa: C901 +def _collect_rows( # noqa: C901, PLR0912, PLR0913, PLR0915 base_rev, experiments, all_headers, @@ -244,7 +244,7 @@ def _extend_row(row, names, headers, items, precision, fill_value=FILL_VALUE): row[f"{fname}:{name}"] = value -def experiments_table( +def experiments_table( # noqa: PLR0913 all_experiments, headers, metric_headers, @@ -308,7 +308,7 @@ def baseline_styler(typ): return {"style": "bold"} if typ == "baseline" else {} -def show_experiments( # noqa: C901 +def show_experiments( # noqa: C901, PLR0912 all_experiments, keep=None, drop=None, diff --git a/dvc/commands/machine.py b/dvc/commands/machine.py index c32d0da20..5dbd32d6a 100644 --- a/dvc/commands/machine.py +++ b/dvc/commands/machine.py @@ -302,7 +302,7 @@ class CmdMachineSsh(CmdBase): return 0 -def add_parser(subparsers, parent_parser): +def add_parser(subparsers, parent_parser): # noqa: PLR0915 from dvc.commands.config import parent_config_parser machine_HELP = "Set up and manage cloud machines." diff --git a/dvc/commands/plots.py b/dvc/commands/plots.py index cc7fea625..3d6485733 100644 --- a/dvc/commands/plots.py +++ b/dvc/commands/plots.py @@ -91,7 +91,7 @@ class CmdPlots(CmdBase): html_template_path = os.path.join(self.repo.dvc_dir, html_template_path) return html_template_path # noqa: RET504 - def run(self) -> int: # noqa: C901 + def run(self) -> int: # noqa: C901, PLR0911, PLR0912 from pathlib import Path from dvc.render.match import match_defs_renderers diff --git a/dvc/compare.py b/dvc/compare.py index 1e0f7b2eb..eb0efa3fa 100644 --- a/dvc/compare.py +++ b/dvc/compare.py @@ -209,7 +209,7 @@ class TabularData(MutableSequence[Sequence["CellT"]]): keys = self.keys() if cols is None else set(cols) return [{k: self._columns[k][i] for k in keys} for i in range(len(self))] - def dropna( # noqa: C901 + def dropna( # noqa: C901, PLR0912 self, axis: str = "rows", how="any", @@ -371,7 +371,7 @@ def diff_table( return td -def show_diff( +def show_diff( # noqa: PLR0913 diff, title: str, old: bool = True, diff --git a/dvc/config_schema.py b/dvc/config_schema.py index f90ef8f58..bdfeed003 100644 --- a/dvc/config_schema.py +++ b/dvc/config_schema.py @@ -30,7 +30,7 @@ def supported_cache_type(types): return types -def Choices(*choices): +def Choices(*choices): # noqa: N802 """Checks that value belongs to the specified set of values Args: @@ -40,7 +40,7 @@ def Choices(*choices): return Any(*choices, msg="expected one of {}".format(", ".join(choices))) -def ByUrl(mapping): +def ByUrl(mapping): # noqa: N802 schemas = walk_values(Schema, mapping) def validate(data): diff --git a/dvc/dagascii.py b/dvc/dagascii.py index 5be1c2250..7b3a984fa 100644 --- a/dvc/dagascii.py +++ b/dvc/dagascii.py @@ -80,7 +80,7 @@ class AsciiCanvas: self.canvas[y][x] = char - def line(self, x0, y0, x1, y1, char): # noqa: C901 + def line(self, x0, y0, x1, y1, char): # noqa: C901, PLR0912 """Create a line on ASCII canvas. Args: @@ -213,8 +213,8 @@ def draw(vertices, edges): # pylint: disable=too-many-locals # NOTE: coordinates might me negative, so we need to shift # everything to the positive plane before we actually draw it. - Xs = [] # pylint: disable=invalid-name - Ys = [] # pylint: disable=invalid-name + Xs = [] # noqa: N806, pylint: disable=invalid-name + Ys = [] # noqa: N806, pylint: disable=invalid-name sug = _build_sugiyama_layout(vertices, edges) diff --git a/dvc/dependency/repo.py b/dvc/dependency/repo.py index ec8d23601..481d67874 100644 --- a/dvc/dependency/repo.py +++ b/dvc/dependency/repo.py @@ -133,7 +133,7 @@ class RepoDependency(Dependency): self._check_circular_import(odb, obj_ids) used_obj_ids[odb].update(obj_ids) except (NoRemoteError, NoOutputOrStageError): - pass # noqa: S110 + pass try: object_store, meta, obj = build( diff --git a/dvc/dvcfile.py b/dvc/dvcfile.py index 4eb78bf21..9f7dc42d5 100644 --- a/dvc/dvcfile.py +++ b/dvc/dvcfile.py @@ -187,7 +187,7 @@ class FileMixin: class SingleStageFile(FileMixin): from dvc.schema import COMPILED_SINGLE_STAGE_SCHEMA as SCHEMA - from dvc.stage.loader import SingleStageLoader as LOADER + from dvc.stage.loader import SingleStageLoader as LOADER # noqa: N814 metrics: List[str] = [] plots: Any = {} @@ -231,7 +231,7 @@ class ProjectFile(FileMixin): """Abstraction for pipelines file, .yaml + .lock combined.""" from dvc.schema import COMPILED_MULTI_STAGE_SCHEMA as SCHEMA - from dvc.stage.loader import StageLoader as LOADER + from dvc.stage.loader import StageLoader as LOADER # noqa: N814 @property def _lockfile(self): diff --git a/dvc/external_repo.py b/dvc/external_repo.py index e273209c9..b1d177e6e 100644 --- a/dvc/external_repo.py +++ b/dvc/external_repo.py @@ -189,7 +189,7 @@ def _cached_clone(url, rev, for_write=False): @wrap_with(threading.Lock()) -def _clone_default_branch(url, rev, for_write=False): # noqa: C901 +def _clone_default_branch(url, rev, for_write=False): # noqa: C901, PLR0912 """Get or create a clean clone of the url. The cloned is reactualized with git pull unless rev is a known sha. diff --git a/dvc/fs/__init__.py b/dvc/fs/__init__.py index b59d41088..ae2544de1 100644 --- a/dvc/fs/__init__.py +++ b/dvc/fs/__init__.py @@ -6,7 +6,6 @@ from dvc.config import ConfigError as RepoConfigError from dvc.config_schema import SCHEMA, Invalid # pylint: disable=unused-import -from dvc_objects.fs import utils # noqa: F401 from dvc_objects.fs import ( # noqa: F401 LocalFileSystem, MemoryFileSystem, @@ -17,6 +16,7 @@ from dvc_objects.fs import ( # noqa: F401 localfs, registry, system, + utils, ) from dvc_objects.fs.base import AnyFSPath, FileSystem # noqa: F401 from dvc_objects.fs.errors import ( # noqa: F401 diff --git a/dvc/fs/dvc.py b/dvc/fs/dvc.py index ad9936b93..b3d56d8ff 100644 --- a/dvc/fs/dvc.py +++ b/dvc/fs/dvc.py @@ -289,7 +289,7 @@ class _DVCFileSystem(AbstractFileSystem): # pylint:disable=abstract-method ): fs_infos[fs.path.name(info["name"])] = info except (FileNotFoundError, NotADirectoryError): - pass # noqa: S110 + pass dvcfiles = kwargs.get("dvcfiles", False) @@ -316,7 +316,9 @@ class _DVCFileSystem(AbstractFileSystem): # pylint:disable=abstract-method ignore_subrepos = kwargs.get("ignore_subrepos", True) return self._info(key, path, ignore_subrepos=ignore_subrepos) - def _info(self, key, path, ignore_subrepos=True, check_ignored=True): # noqa: C901 + def _info( # noqa: C901, PLR0912 + self, key, path, ignore_subrepos=True, check_ignored=True + ): repo, dvc_fs, subkey = self._get_subrepo_info(key) dvc_info = None diff --git a/dvc/logger.py b/dvc/logger.py index 9c69b4d03..be532d407 100644 --- a/dvc/logger.py +++ b/dvc/logger.py @@ -10,46 +10,46 @@ import colorama from dvc.progress import Tqdm -def addLoggingLevel(levelName, levelNum, methodName=None): +def add_logging_level(level_name, level_num, method_name=None): """ Adds a new logging level to the `logging` module and the currently configured logging class. - Uses the existing numeric levelNum if already defined. + Uses the existing numeric level_num if already defined. Based on https://stackoverflow.com/questions/2183233 """ - if methodName is None: - methodName = levelName.lower() + if method_name is None: + method_name = level_name.lower() # If the level name is already defined as a top-level `logging` # constant, then adopt the existing numeric level. - if hasattr(logging, levelName): - existingLevelNum = getattr(logging, levelName) - assert isinstance(existingLevelNum, int) - levelNum = existingLevelNum + if hasattr(logging, level_name): + existing_level_num = getattr(logging, level_name) + assert isinstance(existing_level_num, int) + level_num = existing_level_num - def logForLevel(self, message, *args, **kwargs): - if self.isEnabledFor(levelNum): + def log_for_level(self, message, *args, **kwargs): + if self.isEnabledFor(level_num): # pylint: disable=protected-access - self._log(levelNum, message, args, **kwargs) + self._log(level_num, message, args, **kwargs) - def logToRoot(message, *args, **kwargs): - logging.log(levelNum, message, *args, **kwargs) + def log_to_root(message, *args, **kwargs): + logging.log(level_num, message, *args, **kwargs) # getLevelName resolves the numeric log level if already defined, # otherwise returns a string - if not isinstance(logging.getLevelName(levelName), int): - logging.addLevelName(levelNum, levelName) + if not isinstance(logging.getLevelName(level_name), int): + logging.addLevelName(level_num, level_name) - if not hasattr(logging, levelName): - setattr(logging, levelName, levelNum) + if not hasattr(logging, level_name): + setattr(logging, level_name, level_num) - if not hasattr(logging.getLoggerClass(), methodName): - setattr(logging.getLoggerClass(), methodName, logForLevel) + if not hasattr(logging.getLoggerClass(), method_name): + setattr(logging.getLoggerClass(), method_name, log_for_level) - if not hasattr(logging, methodName): - setattr(logging, methodName, logToRoot) + if not hasattr(logging, method_name): + setattr(logging, method_name, log_to_root) class LoggingException(Exception): @@ -129,7 +129,7 @@ class ColorFormatter(logging.Formatter): class LoggerHandler(logging.StreamHandler): - def handleError(self, record): + def handleError(self, record): # noqa: N802 super().handleError(record) raise LoggingException(record) @@ -147,7 +147,7 @@ class LoggerHandler(logging.StreamHandler): if not _is_verbose(): return except Exception: # noqa, pylint: disable=broad-except - pass # noqa: S110 + pass msg = self.format(record) Tqdm.write(msg, file=self.stream, end=getattr(self, "terminator", "\n")) @@ -190,7 +190,7 @@ def setup(level: int = logging.INFO, log_colors: bool = True) -> None: console_debug.setFormatter(formatter) console_debug.addFilter(exclude_filter(logging.INFO)) - addLoggingLevel("TRACE", logging.DEBUG - 5) + add_logging_level("TRACE", logging.DEBUG - 5) console_trace = LoggerHandler(sys.stdout) console_trace.setLevel(logging.TRACE) # type: ignore[attr-defined] diff --git a/dvc/output.py b/dvc/output.py index 8eb6b4a5d..ee1f89d31 100644 --- a/dvc/output.py +++ b/dvc/output.py @@ -312,7 +312,7 @@ class Output: IsStageFileError: Type[DvcException] = OutputIsStageFileError IsIgnoredError: Type[DvcException] = OutputIsIgnoredError - def __init__( + def __init__( # noqa: PLR0913 self, stage, path, @@ -768,7 +768,7 @@ class Output: ) return checkout_obj - def dumpd(self, **kwargs): # noqa: C901 + def dumpd(self, **kwargs): # noqa: C901, PLR0912 ret: Dict[str, Any] = {} with_files = ( (not self.IS_DEPENDENCY or self.stage.is_import) @@ -1059,7 +1059,7 @@ class Output: return obj.filter(prefix) return cast(Tree, obj) - def get_used_objs( # noqa: C901 + def get_used_objs( # noqa: C901, PLR0911 self, **kwargs ) -> Dict[Optional["ObjectDB"], Set["HashInfo"]]: """Return filtered set of used object IDs for this out.""" diff --git a/dvc/parsing/context.py b/dvc/parsing/context.py index 0cb73b650..221c5feab 100644 --- a/dvc/parsing/context.py +++ b/dvc/parsing/context.py @@ -155,7 +155,7 @@ class Value(Node): PRIMITIVES = (int, float, str, bytes, bool) -class Container(Node, ABC): # noqa: B024 +class Container(Node, ABC): meta: Meta data: Union[list, dict] _key_transform = staticmethod(identity) diff --git a/dvc/parsing/versions.py b/dvc/parsing/versions.py index 2055a4d09..4b0f634ef 100644 --- a/dvc/parsing/versions.py +++ b/dvc/parsing/versions.py @@ -19,7 +19,7 @@ class VersionEnum(str, enum.Enum): return [v.value for v in cls] -class LOCKFILE_VERSION(VersionEnum): +class LOCKFILE_VERSION(VersionEnum): # noqa: N801 V1 = "1.0" V2 = "2.0" diff --git a/dvc/progress.py b/dvc/progress.py index e1831df8d..057731270 100644 --- a/dvc/progress.py +++ b/dvc/progress.py @@ -36,7 +36,7 @@ class Tqdm(tqdm): "miniters": 1, } - def __init__( + def __init__( # noqa: PLR0913 self, iterable=None, disable=None, diff --git a/dvc/render/converter/vega.py b/dvc/render/converter/vega.py index 258a06aec..b96b40e38 100644 --- a/dvc/render/converter/vega.py +++ b/dvc/render/converter/vega.py @@ -193,7 +193,7 @@ class VegaConverter(Converter): return first(fields) return "x" - def flat_datapoints(self, revision): # noqa: C901 + def flat_datapoints(self, revision): # noqa: C901, PLR0912 file2datapoints, properties = self.convert() props_update = {} diff --git a/dvc/repo/__init__.py b/dvc/repo/__init__.py index 9e0c7b150..383bad9cf 100644 --- a/dvc/repo/__init__.py +++ b/dvc/repo/__init__.py @@ -149,7 +149,7 @@ class Repo: self.fs.makedirs(db_dir, exist_ok=True) return db_dir - def __init__( + def __init__( # noqa: PLR0915 self, root_dir: Optional[str] = None, fs: Optional["FileSystem"] = None, @@ -453,7 +453,7 @@ class Repo: return brancher(self, *args, **kwargs) - def used_objs( + def used_objs( # noqa: PLR0913 self, targets=None, all_branches=False, diff --git a/dvc/repo/add.py b/dvc/repo/add.py index e9b88db65..8f20d523c 100644 --- a/dvc/repo/add.py +++ b/dvc/repo/add.py @@ -148,7 +148,7 @@ VALIDATORS = ( @validate(*VALIDATORS) @locked @scm_context -def add( # noqa: C901 +def add( repo: "Repo", targets: "TargetType", recursive: bool = False, diff --git a/dvc/repo/experiments/__init__.py b/dvc/repo/experiments/__init__.py index 6d836a02a..b995febb7 100644 --- a/dvc/repo/experiments/__init__.py +++ b/dvc/repo/experiments/__init__.py @@ -407,7 +407,7 @@ class Experiments: try: name = ExpRefInfo.from_ref(ref).name except InvalidExpRefError: - pass # noqa: S110 + pass if not name: if rev in self.stash_revs: name = self.stash_revs[rev].name diff --git a/dvc/repo/experiments/apply.py b/dvc/repo/experiments/apply.py index 843bfeb3e..b1b5a4d2e 100644 --- a/dvc/repo/experiments/apply.py +++ b/dvc/repo/experiments/apply.py @@ -49,7 +49,7 @@ def apply(repo: "Repo", rev: str, force: bool = True, **kwargs): # noqa: C901 exp_rev = repo.scm.get_ref(str(exp_ref_info)) elif queue_entry: if queue_entry.baseline_rev != baseline_sha: - raise InvalidExpRevError(rev) + raise InvalidExpRevError(rev) # noqa: B904 exp_rev = queue_entry.stash_rev is_stash = True else: diff --git a/dvc/repo/experiments/init.py b/dvc/repo/experiments/init.py index a776b73e2..20e7b282f 100644 --- a/dvc/repo/experiments/init.py +++ b/dvc/repo/experiments/init.py @@ -21,9 +21,9 @@ from dvc.exceptions import DvcException from dvc.stage import PipelineStage if TYPE_CHECKING: + from dvc.dependency import Dependency from dvc.dvcfile import ProjectFile, SingleStageFile from dvc.repo import Repo - from dvc.dependency import Dependency from dvc.ui import ui diff --git a/dvc/repo/experiments/queue/base.py b/dvc/repo/experiments/queue/base.py index 114aab63e..32d80bab2 100644 --- a/dvc/repo/experiments/queue/base.py +++ b/dvc/repo/experiments/queue/base.py @@ -295,7 +295,7 @@ class BaseStashQueue(ABC): output. """ - def _stash_exp( # noqa: C901 + def _stash_exp( # noqa: PLR0915, C901 self, *args, params: Optional[Dict[str, List[str]]] = None, diff --git a/dvc/repo/experiments/queue/remove.py b/dvc/repo/experiments/queue/remove.py index 34f6f106c..d709ff8ad 100644 --- a/dvc/repo/experiments/queue/remove.py +++ b/dvc/repo/experiments/queue/remove.py @@ -9,7 +9,7 @@ if TYPE_CHECKING: from dvc.repo.experiments.stash import ExpStashEntry -def remove_tasks( # noqa: C901 +def remove_tasks( # noqa: C901, PLR0912 celery_queue: "LocalCeleryQueue", queue_entries: Iterable["QueueEntry"], ): diff --git a/dvc/repo/experiments/show.py b/dvc/repo/experiments/show.py index 83b9f3624..9917e4f70 100644 --- a/dvc/repo/experiments/show.py +++ b/dvc/repo/experiments/show.py @@ -383,7 +383,7 @@ def move_properties_to_head(result: Dict[str, Dict[str, Dict[str, Any]]]): checkpoint = True -def show( +def show( # noqa: PLR0913 repo: "Repo", all_branches=False, all_tags=False, diff --git a/dvc/repo/experiments/utils.py b/dvc/repo/experiments/utils.py index e8ed3ba97..4d5a14480 100644 --- a/dvc/repo/experiments/utils.py +++ b/dvc/repo/experiments/utils.py @@ -294,8 +294,8 @@ def fetch_all_exps(scm: "Git", url: str, progress: Optional[Callable] = None): def get_random_exp_name(scm, baseline_rev): # fmt: off - NOUNS = ('abac', 'abbs', 'aces', 'acid', 'acne', 'acre', 'acts', 'ados', 'adze', 'afro', 'agas', 'aged', 'ages', 'agio', 'agma', 'airs', 'airt', 'aits', 'akes', 'alap', 'albs', 'alga', 'ally', 'alto', 'amah', 'ambo', 'amie', 'amyl', 'ankh', 'apex', 'aqua', 'arcs', 'areg', 'aria', 'aril', 'arks', 'army', 'auks', 'aune', 'aura', 'awls', 'awns', 'axon', 'azan', 'baby', 'bade', 'bael', 'bags', 'bait', 'ball', 'banc', 'bang', 'bani', 'barb', 'bark', 'bate', 'bats', 'bawl', 'beak', 'bean', 'beep', 'belt', 'berk', 'beth', 'bias', 'bice', 'bids', 'bind', 'bise', 'bish', 'bite', 'boar', 'boat', 'body', 'boff', 'bold', 'boll', 'bolo', 'bomb', 'bond', 'book', 'boor', 'boot', 'bort', 'bosk', 'bots', 'bott', 'bout', 'bras', 'bree', 'brig', 'brio', 'buck', 'buhl', 'bump', 'bunk', 'bunt', 'buoy', 'byes', 'byte', 'cane', 'cant', 'caps', 'care', 'cart', 'cats', 'cedi', 'ceps', 'cere', 'chad', 'cham', 'chat', 'chay', 'chic', 'chin', 'chis', 'chiv', 'choc', 'chow', 'chum', 'ciao', 'cigs', 'clay', 'clip', 'clog', 'coal', 'coat', 'code', 'coed', 'cogs', 'coho', 'cole', 'cols', 'colt', 'conk', 'cons', 'cony', 'coof', 'cook', 'cool', 'coos', 'corm', 'cors', 'coth', 'cows', 'coze', 'crag', 'craw', 'cree', 'crib', 'cuds', 'cull', 'cult', 'curb', 'curn', 'curs', 'cusp', 'cuss', 'cwms', 'cyma', 'cyst', 'dabs', 'dado', 'daff', 'dais', 'daks', 'damn', 'dams', 'darg', 'dart', 'data', 'dawk', 'dawn', 'daws', 'daze', 'dean', 'debs', 'debt', 'deep', 'dees', 'dele', 'delf', 'dent', 'deys', 'dhow', 'digs', 'dirk', 'dita', 'diva', 'divs', 'doek', 'doge', 'dogs', 'dogy', 'dohs', 'doit', 'dole', 'doll', 'dolt', 'dona', 'dook', 'door', 'dops', 'doss', 'doxy', 'drab', 'drop', 'drum', 'duad', 'duct', 'duff', 'duke', 'dunk', 'dunt', 'ears', 'ease', 'eggs', 'eild', 'emeu', 'emus', 'envy', 'epha', 'eric', 'erns', 'esne', 'esse', 'ewes', 'expo', 'eyas', 'eyot', 'eyry', 'fare', 'farl', 'farm', 'feds', 'feel', 'fees', 'feme', 'fess', 'fibs', 'fids', 'fils', 'firm', 'fish', 'flab', 'flap', 'flea', 'flew', 'flex', 'flip', 'flit', 'flus', 'flux', 'foil', 'fond', 'food', 'fool', 'ford', 'fore', 'frit', 'friz', 'froe', 'funs', 'furl', 'fuss', 'fuzz', 'gaby', 'gaff', 'gale', 'gang', 'gaol', 'gape', 'gash', 'gaur', 'gaze', 'gear', 'genu', 'gest', 'geum', 'ghat', 'gigs', 'gimp', 'gird', 'girl', 'glee', 'glen', 'glia', 'glop', 'gnat', 'goad', 'goaf', 'gobs', 'gonk', 'good', 'goos', 'gore', 'gram', 'gray', 'grig', 'grip', 'grot', 'grub', 'gude', 'gula', 'gulf', 'guns', 'gust', 'gyms', 'gyro', 'hack', 'haet', 'hajj', 'hake', 'half', 'halm', 'hard', 'harl', 'hask', 'hate', "he'd", 'heck', 'heel', 'heir', 'help', 'hems', 'here', 'hill', 'hips', 'hits', 'hobo', 'hock', 'hogs', 'hold', 'holy', 'hood', 'hoot', 'hope', 'horn', 'hose', 'hour', 'hows', 'huck', 'hugs', 'huia', 'hulk', 'hull', 'hunk', 'hunt', 'huts', 'hymn', 'ibex', 'ices', 'iglu', 'impi', 'inks', 'inti', 'ions', 'iota', 'iron', 'jabs', 'jags', 'jake', 'jass', 'jato', 'jaws', 'jean', 'jeer', 'jerk', 'jest', 'jiao', 'jigs', 'jill', 'jinn', 'jird', 'jive', 'jock', 'joey', 'jogs', 'joss', 'jota', 'jots', 'juba', 'jube', 'judo', 'jump', 'junk', 'jura', 'juts', 'jynx', 'kago', 'kail', 'kaka', 'kale', 'kana', 'keek', 'keep', 'kefs', 'kegs', 'kerf', 'kern', 'keys', 'kibe', 'kick', 'kids', 'kifs', 'kill', 'kina', 'kind', 'kine', 'kite', 'kiwi', 'knap', 'knit', 'koas', 'kobs', 'kyat', 'lack', 'lahs', 'lair', 'lama', 'lamb', 'lame', 'lats', 'lava', 'lays', 'leaf', 'leak', 'leas', 'lees', 'leks', 'leno', 'libs', 'lich', 'lick', 'lien', 'lier', 'lieu', 'life', 'lift', 'limb', 'line', 'link', 'linn', 'lira', 'loft', 'loge', 'loir', 'long', 'loof', 'look', 'loot', 'lore', 'loss', 'lots', 'loup', 'love', 'luce', 'ludo', 'luke', 'lulu', 'lure', 'lush', 'magi', 'maid', 'main', 'mako', 'male', 'mana', 'many', 'mart', 'mash', 'mast', 'mate', 'math', 'mats', 'matt', 'maul', 'maya', 'mays', 'meal', 'mean', 'meed', 'mela', 'mene', 'mere', 'merk', 'mesh', 'mete', 'mice', 'milo', 'mime', 'mina', 'mine', 'mirk', 'miss', 'mobs', 'moit', 'mold', 'molt', 'mome', 'moms', 'monk', 'moot', 'mope', 'more', 'morn', 'mows', 'moxa', 'much', 'mung', 'mush', 'muss', 'myth', 'name', 'nard', 'nark', 'nave', 'navy', 'neck', 'newt', 'nibs', 'nims', 'nine', 'nock', 'noil', 'noma', 'nosh', 'nowt', 'nuke', 'oafs', 'oast', 'oats', 'obit', 'odor', 'okra', 'omer', 'oner', 'ones', 'orcs', 'ords', 'orfe', 'orle', 'ossa', 'outs', 'over', 'owls', 'pail', 'pall', 'palp', 'pams', 'pang', 'pans', 'pant', 'paps', 'pate', 'pats', 'paws', 'pear', 'peba', 'pech', 'pecs', 'peel', 'peer', 'pees', 'pein', 'peri', 'phon', 'pice', 'pita', 'pith', 'play', 'plop', 'plot', 'plow', 'plug', 'plum', 'polo', 'pomp', 'pond', 'pons', 'pony', 'poof', 'pope', 'poss', 'pots', 'pour', 'prad', 'prat', 'prep', 'prob', 'prof', 'prow', 'puck', 'puds', 'puke', 'puku', 'pump', 'puns', 'pupa', 'purl', 'pyre', 'quad', 'quay', 'quey', 'quiz', 'raid', 'rail', 'rain', 'raja', 'rale', 'rams', 'rand', 'rant', 'raps', 'rasp', 'razz', 'rede', 'reef', 'reif', 'rein', 'repp', 'rial', 'ribs', 'rick', 'rift', 'rill', 'rime', 'rims', 'ring', 'rins', 'rise', 'rite', 'rits', 'roam', 'robe', 'rods', 'roma', 'rook', 'rort', 'rotl', 'roup', 'roux', 'rube', 'rubs', 'ruby', 'rues', 'rugs', 'ruin', 'runs', 'ryas', 'sack', 'sacs', 'saga', 'sail', 'sale', 'salp', 'salt', 'sand', 'sang', 'sash', 'saut', 'says', 'scab', 'scow', 'scud', 'scup', 'scut', 'seal', 'seam', 'sech', 'seed', 'seep', 'seer', 'self', 'sena', 'send', 'sera', 'sere', 'shad', 'shah', 'sham', 'shay', 'shes', 'ship', 'shoe', 'sick', 'sida', 'sign', 'sike', 'sima', 'sine', 'sing', 'sinh', 'sink', 'sins', 'site', 'size', 'skat', 'skin', 'skip', 'skis', 'slaw', 'sled', 'slew', 'sley', 'slob', 'slue', 'slug', 'smut', 'snap', 'snib', 'snip', 'snob', 'snog', 'snot', 'snow', 'snub', 'snug', 'soft', 'soja', 'soke', 'song', 'sons', 'sook', 'sorb', 'sori', 'souk', 'soul', 'sous', 'soya', 'spit', 'stay', 'stew', 'stir', 'stob', 'stud', 'suds', 'suer', 'suit', 'sumo', 'sums', 'sups', 'suqs', 'suss', 'sway', 'syce', 'synd', 'taal', 'tach', 'taco', 'tads', 'taka', 'tale', 'tamp', 'tams', 'tang', 'tans', 'tape', 'tare', 'taro', 'tarp', 'tart', 'tass', 'taus', 'teat', 'teds', 'teff', 'tegu', 'tell', 'term', 'thar', 'thaw', 'tics', 'tier', 'tiff', 'tils', 'tilt', 'tint', 'tipi', 'tire', 'tirl', 'toby', 'tods', 'toea', 'toff', 'toga', 'toil', 'toke', 'tola', 'tole', 'tomb', 'toms', 'torc', 'tors', 'tort', 'tosh', 'tote', 'tret', 'trey', 'trio', 'trug', 'tuck', 'tugs', 'tule', 'tune', 'tuns', 'tuts', 'tyke', 'tyne', 'typo', 'ulna', 'umbo', 'unau', 'unit', 'upas', 'user', 'uvea', 'vacs', 'vane', 'vang', 'vans', 'vara', 'vase', 'veep', 'veer', 'vega', 'veil', 'vela', 'vent', 'vies', 'view', 'vina', 'vine', 'vise', 'vlei', 'volt', 'vows', 'wads', 'waft', 'wage', 'wain', 'walk', 'want', 'wart', 'wave', 'waws', 'weal', 'wean', 'weds', 'weep', 'weft', 'weir', 'weka', 'weld', 'wens', 'weys', 'whap', 'whey', 'whin', 'whit', 'whop', 'wide', 'wife', 'wind', 'wine', 'wino', 'wins', 'wire', 'wise', 'woes', 'wont', 'wool', 'work', 'worm', 'wort', 'yack', 'yank', 'yapp', 'yard', 'yate', 'yawl', 'yegg', 'yell', 'yeuk', 'yews', 'yips', 'yobs', 'yogi', 'yoke', 'yolk', 'yoni', 'zack', 'zags', 'zest', 'zhos', 'zigs', 'zila', 'zips', 'ziti', 'zoea', 'zone', 'zoon') # noqa: E501, Q000 - ADJECTIVES = ('about', 'above', 'abuzz', 'acerb', 'acold', 'acred', 'added', 'addle', 'adept', 'adult', 'adunc', 'adust', 'afoul', 'after', 'agape', 'agaze', 'agile', 'aging', 'agley', 'aglow', 'ahead', 'ahull', 'aided', 'alary', 'algal', 'alike', 'alive', 'alone', 'aloof', 'alpha', 'amber', 'amiss', 'amort', 'ample', 'amuck', 'angry', 'anile', 'apeak', 'apish', 'arced', 'areal', 'armed', 'aroid', 'ashen', 'aspen', 'astir', 'atilt', 'atrip', 'aulic', 'aural', 'awash', 'awful', 'awing', 'awned', 'axile', 'azoic', 'azure', 'baggy', 'baked', 'balky', 'bally', 'balmy', 'banal', 'bandy', 'bardy', 'bared', 'barer', 'barky', 'basal', 'based', 'baser', 'basic', 'batty', 'bawdy', 'beady', 'beaky', 'beamy', 'beaut', 'beefy', 'beery', 'beige', 'bendy', 'bifid', 'bijou', 'biped', 'birch', 'bitty', 'blame', 'bland', 'blank', 'blear', 'blest', 'blind', 'blond', 'blown', 'blowy', 'bluer', 'bluff', 'blunt', 'boned', 'bonny', 'boozy', 'bored', 'boric', 'bosky', 'bosom', 'bound', 'bovid', 'bowed', 'boxed', 'braky', 'brash', 'brief', 'briny', 'brisk', 'broad', 'broch', 'brood', 'brown', 'brute', 'buggy', 'bulgy', 'bumpy', 'burly', 'burnt', 'burry', 'bushy', 'busty', 'butch', 'buxom', 'cadgy', 'cagey', 'calmy', 'campy', 'canny', 'caped', 'cased', 'catty', 'cauld', 'cedar', 'cered', 'ceric', 'chary', 'cheap', 'cheek', 'chewy', 'chief', 'chill', 'chirk', 'choky', 'cissy', 'civil', 'cleft', 'coaly', 'color', 'comfy', 'comic', 'compo', 'conic', 'couth', 'coxal', 'crack', 'crank', 'crash', 'crass', 'crisp', 'cronk', 'cross', 'crude', 'cruel', 'crumb', 'cured', 'curly', 'curst', 'cushy', 'cutty', 'cynic', 'dated', 'dazed', 'dedal', 'deism', 'diazo', 'dicey', 'dingy', 'direr', 'dirty', 'dishy', 'dizzy', 'dolce', 'doped', 'dopey', 'dormy', 'dorty', 'dosed', 'dotal', 'dotty', 'dowdy', 'dowie', 'downy', 'dozen', 'drawn', 'dread', 'drear', 'dress', 'dried', 'ducky', 'duddy', 'dummy', 'dumpy', 'duple', 'dural', 'dusky', 'dusty', 'dutch', 'dying', 'eager', 'eaten', 'ebony', 'edged', 'eerie', 'eight', 'elder', 'elect', 'elfin', 'elite', 'empty', 'enate', 'enemy', 'epoxy', 'erect', 'ethic', 'every', 'extra', 'faced', 'faery', 'faint', 'famed', 'fancy', 'farci', 'fatal', 'fated', 'fatty', 'fazed', 'felon', 'fenny', 'ferny', 'fetal', 'fetid', 'fewer', 'fiery', 'fifty', 'filar', 'filmy', 'final', 'fined', 'finer', 'finny', 'fired', 'first', 'fishy', 'fixed', 'fizzy', 'flaky', 'flamy', 'flash', 'flawy', 'fleet', 'flory', 'flown', 'fluid', 'fluky', 'flush', 'focal', 'foggy', 'folio', 'forky', 'forte', 'forty', 'found', 'frail', 'frank', 'freed', 'freer', 'fresh', 'fried', 'front', 'frore', 'fuggy', 'funky', 'funny', 'furry', 'fusil', 'fussy', 'fuzzy', 'gabby', 'gamer', 'gamey', 'gamic', 'gammy', 'garni', 'gauge', 'gaunt', 'gauzy', 'gawky', 'gawsy', 'gemmy', 'genal', 'genic', 'ghast', 'gimpy', 'girly', 'glare', 'glary', 'glial', 'glued', 'gluey', 'godly', 'gooey', 'goofy', 'goosy', 'gouty', 'grade', 'grand', 'grapy', 'grave', 'gross', 'group', 'gruff', 'guest', 'gules', 'gulfy', 'gummy', 'gushy', 'gusty', 'gutsy', 'gutta', 'gypsy', 'gyral', 'hadal', 'hammy', 'handy', 'hardy', 'hasty', 'hated', 'hazel', 'heady', 'heapy', 'hefty', 'heigh', 'hempy', 'herby', 'hexed', 'hi-fi', 'hilly', 'hired', 'holey', 'honey', 'hooly', 'hoven', 'huger', 'hulky', 'humid', 'hunky', 'hyoid', 'idled', 'iliac', 'inane', 'incog', 'inert', 'inner', 'inter', 'iodic', 'ionic', 'irate', 'irony', 'itchy', 'jaggy', 'jammy', 'japan', 'jazzy', 'jerky', 'jetty', 'joint', 'jowly', 'juicy', 'jumpy', 'jural', 'kacha', 'kaput', 'kempt', 'keyed', 'kinky', 'known', 'kooky', 'kraal', 'laced', 'laigh', 'lairy', 'lamer', 'lardy', 'larky', 'lated', 'later', 'lathy', 'leady', 'leafy', 'leaky', 'leary', 'least', 'ledgy', 'leery', 'legal', 'leggy', 'lento', 'level', 'licht', 'licit', 'liege', 'light', 'liked', 'liney', 'lippy', 'lived', 'livid', 'loamy', 'loath', 'lobar', 'local', 'loony', 'loose', 'loral', 'losel', 'lousy', 'loved', 'lower', 'lowly', 'lowse', 'loyal', 'lucid', 'lucky', 'lumpy', 'lunar', 'lurid', 'lushy', 'lying', 'lyric', 'macho', 'macro', 'magic', 'major', 'malar', 'mangy', 'manky', 'manly', 'mardy', 'massy', 'mated', 'matte', 'mauve', 'mazed', 'mealy', 'meaty', 'medal', 'melic', 'mesic', 'mesne', 'messy', 'metal', 'miffy', 'milky', 'mined', 'minim', 'minor', 'minus', 'mired', 'mirky', 'misty', 'mixed', 'modal', 'model', 'moire', 'molar', 'moldy', 'moody', 'moony', 'mopey', 'moral', 'mossy', 'mothy', 'motor', 'mousy', 'moved', 'mucid', 'mucky', 'muddy', 'muggy', 'muley', 'mural', 'murky', 'mushy', 'muted', 'muzzy', 'myoid', 'naggy', 'naive', 'naked', 'named', 'nasty', 'natal', 'naval', 'nervy', 'newsy', 'nicer', 'niffy', 'nifty', 'ninth', 'nitty', 'nival', 'noble', 'nodal', 'noisy', 'non-U', 'north', 'nosed', 'noted', 'nowed', 'nubby', 'oaken', 'oared', 'oaten', 'obese', 'ocher', 'ochre', 'often', 'ohmic', 'oiled', 'olden', 'older', 'oleic', 'olive', 'optic', 'ortho', 'osmic', 'other', 'outer', 'ovoid', 'owing', 'owned', 'paced', 'pagan', 'paled', 'paler', 'pally', 'paper', 'pappy', 'parky', 'party', 'pasty', 'pavid', 'pawky', 'peaky', 'pearl', 'peart', 'peaty', 'pedal', 'peppy', 'perdu', 'perky', 'pesky', 'phony', 'piano', 'picky', 'piled', 'piney', 'pious', 'pique', 'pithy', 'platy', 'plump', 'plush', 'podgy', 'potty', 'power', 'prest', 'pricy', 'prima', 'prime', 'print', 'privy', 'prize', 'prone', 'proof', 'prosy', 'proud', 'proxy', 'pseud', 'pucka', 'pudgy', 'puffy', 'pukka', 'pupal', 'purer', 'pursy', 'pushy', 'pyoid', 'quack', 'quare', 'quasi', 'quiet', 'quits', 'rabic', 'rabid', 'radio', 'raked', 'randy', 'rapid', 'rarer', 'raspy', 'rathe', 'ratty', 'ready', 'reedy', 'reeky', 'refer', 'regal', 'riant', 'ridgy', 'right', 'riled', 'rimed', 'rindy', 'risen', 'risky', 'ritzy', 'rival', 'riven', 'robed', 'rocky', 'roily', 'roman', 'rooky', 'ropey', 'round', 'rowdy', 'ruddy', 'ruled', 'rummy', 'runic', 'runny', 'runty', 'rural', 'rusty', 'rutty', 'sable', 'salic', 'sandy', 'sappy', 'sarky', 'sassy', 'sated', 'saved', 'savvy', 'scald', 'scaly', 'scary', 'score', 'scrap', 'sedgy', 'seely', 'seral', 'sewed', 'shaky', 'sharp', 'sheen', 'shier', 'shill', 'shoal', 'shock', 'shoed', 'shore', 'short', 'shyer', 'silky', 'silly', 'silty', 'sixth', 'sixty', 'skint', 'slack', 'slant', 'sleek', 'slier', 'slimy', 'slung', 'small', 'smart', 'smoky', 'snaky', 'sneak', 'snide', 'snowy', 'snuff', 'so-so', 'soapy', 'sober', 'socko', 'solar', 'soled', 'solid', 'sonic', 'sooth', 'sooty', 'soppy', 'sorer', 'sound', 'soupy', 'spent', 'spicy', 'spiky', 'spiny', 'spiry', 'splay', 'split', 'sport', 'spumy', 'squat', 'staid', 'stiff', 'still', 'stoic', 'stone', 'stony', 'store', 'stout', 'straw', 'stray', 'strip', 'stung', 'suave', 'sudsy', 'sulfa', 'sulky', 'sunny', 'super', 'sural', 'surer', 'surfy', 'surgy', 'surly', 'swell', 'swept', 'swish', 'sworn', 'tabby', 'taboo', 'tacit', 'tacky', 'tamed', 'tamer', 'tangy', 'taped', 'tarot', 'tarry', 'tasty', 'tatty', 'taunt', 'tawie', 'teary', 'techy', 'telic', 'tenor', 'tense', 'tenth', 'tenty', 'tepid', 'terse', 'testy', 'third', 'tidal', 'tight', 'tiled', 'timid', 'tinct', 'tined', 'tippy', 'tipsy', 'tonal', 'toned', 'tonic', 'toric', 'total', 'tough', 'toxic', 'trade', 'treed', 'treen', 'trial', 'truer', 'tubal', 'tubby', 'tumid', 'tuned', 'tutti', 'twill', 'typal', 'typed', 'typic', 'umber', 'unapt', 'unbid', 'uncut', 'undue', 'undug', 'unfed', 'unfit', 'union', 'unlet', 'unmet', 'unwed', 'unwet', 'upper', 'upset', 'urban', 'utile', 'uveal', 'vagal', 'valid', 'vapid', 'varus', 'vatic', 'veiny', 'vital', 'vivid', 'vocal', 'vogie', 'volar', 'vying', 'wacky', 'wally', 'waney', 'warty', 'washy', 'waspy', 'waste', 'waugh', 'waxen', 'webby', 'wedgy', 'weeny', 'weepy', 'weest', 'weird', 'welsh', 'wersh', 'whist', 'white', 'whity', 'whole', 'wider', 'wight', 'winey', 'wired', 'wised', 'wiser', 'withy', 'wonky', 'woods', 'woozy', 'world', 'wormy', 'worse', 'worst', 'woven', 'wrath', 'wrier', 'wrong', 'wroth', 'xeric', 'yarer', 'yolky', 'young', 'yucky', 'yummy', 'zesty', 'zingy', 'zinky', 'zippy', 'zonal') # noqa: E501, Q000 + NOUNS = ('abac', 'abbs', 'aces', 'acid', 'acne', 'acre', 'acts', 'ados', 'adze', 'afro', 'agas', 'aged', 'ages', 'agio', 'agma', 'airs', 'airt', 'aits', 'akes', 'alap', 'albs', 'alga', 'ally', 'alto', 'amah', 'ambo', 'amie', 'amyl', 'ankh', 'apex', 'aqua', 'arcs', 'areg', 'aria', 'aril', 'arks', 'army', 'auks', 'aune', 'aura', 'awls', 'awns', 'axon', 'azan', 'baby', 'bade', 'bael', 'bags', 'bait', 'ball', 'banc', 'bang', 'bani', 'barb', 'bark', 'bate', 'bats', 'bawl', 'beak', 'bean', 'beep', 'belt', 'berk', 'beth', 'bias', 'bice', 'bids', 'bind', 'bise', 'bish', 'bite', 'boar', 'boat', 'body', 'boff', 'bold', 'boll', 'bolo', 'bomb', 'bond', 'book', 'boor', 'boot', 'bort', 'bosk', 'bots', 'bott', 'bout', 'bras', 'bree', 'brig', 'brio', 'buck', 'buhl', 'bump', 'bunk', 'bunt', 'buoy', 'byes', 'byte', 'cane', 'cant', 'caps', 'care', 'cart', 'cats', 'cedi', 'ceps', 'cere', 'chad', 'cham', 'chat', 'chay', 'chic', 'chin', 'chis', 'chiv', 'choc', 'chow', 'chum', 'ciao', 'cigs', 'clay', 'clip', 'clog', 'coal', 'coat', 'code', 'coed', 'cogs', 'coho', 'cole', 'cols', 'colt', 'conk', 'cons', 'cony', 'coof', 'cook', 'cool', 'coos', 'corm', 'cors', 'coth', 'cows', 'coze', 'crag', 'craw', 'cree', 'crib', 'cuds', 'cull', 'cult', 'curb', 'curn', 'curs', 'cusp', 'cuss', 'cwms', 'cyma', 'cyst', 'dabs', 'dado', 'daff', 'dais', 'daks', 'damn', 'dams', 'darg', 'dart', 'data', 'dawk', 'dawn', 'daws', 'daze', 'dean', 'debs', 'debt', 'deep', 'dees', 'dele', 'delf', 'dent', 'deys', 'dhow', 'digs', 'dirk', 'dita', 'diva', 'divs', 'doek', 'doge', 'dogs', 'dogy', 'dohs', 'doit', 'dole', 'doll', 'dolt', 'dona', 'dook', 'door', 'dops', 'doss', 'doxy', 'drab', 'drop', 'drum', 'duad', 'duct', 'duff', 'duke', 'dunk', 'dunt', 'ears', 'ease', 'eggs', 'eild', 'emeu', 'emus', 'envy', 'epha', 'eric', 'erns', 'esne', 'esse', 'ewes', 'expo', 'eyas', 'eyot', 'eyry', 'fare', 'farl', 'farm', 'feds', 'feel', 'fees', 'feme', 'fess', 'fibs', 'fids', 'fils', 'firm', 'fish', 'flab', 'flap', 'flea', 'flew', 'flex', 'flip', 'flit', 'flus', 'flux', 'foil', 'fond', 'food', 'fool', 'ford', 'fore', 'frit', 'friz', 'froe', 'funs', 'furl', 'fuss', 'fuzz', 'gaby', 'gaff', 'gale', 'gang', 'gaol', 'gape', 'gash', 'gaur', 'gaze', 'gear', 'genu', 'gest', 'geum', 'ghat', 'gigs', 'gimp', 'gird', 'girl', 'glee', 'glen', 'glia', 'glop', 'gnat', 'goad', 'goaf', 'gobs', 'gonk', 'good', 'goos', 'gore', 'gram', 'gray', 'grig', 'grip', 'grot', 'grub', 'gude', 'gula', 'gulf', 'guns', 'gust', 'gyms', 'gyro', 'hack', 'haet', 'hajj', 'hake', 'half', 'halm', 'hard', 'harl', 'hask', 'hate', "he'd", 'heck', 'heel', 'heir', 'help', 'hems', 'here', 'hill', 'hips', 'hits', 'hobo', 'hock', 'hogs', 'hold', 'holy', 'hood', 'hoot', 'hope', 'horn', 'hose', 'hour', 'hows', 'huck', 'hugs', 'huia', 'hulk', 'hull', 'hunk', 'hunt', 'huts', 'hymn', 'ibex', 'ices', 'iglu', 'impi', 'inks', 'inti', 'ions', 'iota', 'iron', 'jabs', 'jags', 'jake', 'jass', 'jato', 'jaws', 'jean', 'jeer', 'jerk', 'jest', 'jiao', 'jigs', 'jill', 'jinn', 'jird', 'jive', 'jock', 'joey', 'jogs', 'joss', 'jota', 'jots', 'juba', 'jube', 'judo', 'jump', 'junk', 'jura', 'juts', 'jynx', 'kago', 'kail', 'kaka', 'kale', 'kana', 'keek', 'keep', 'kefs', 'kegs', 'kerf', 'kern', 'keys', 'kibe', 'kick', 'kids', 'kifs', 'kill', 'kina', 'kind', 'kine', 'kite', 'kiwi', 'knap', 'knit', 'koas', 'kobs', 'kyat', 'lack', 'lahs', 'lair', 'lama', 'lamb', 'lame', 'lats', 'lava', 'lays', 'leaf', 'leak', 'leas', 'lees', 'leks', 'leno', 'libs', 'lich', 'lick', 'lien', 'lier', 'lieu', 'life', 'lift', 'limb', 'line', 'link', 'linn', 'lira', 'loft', 'loge', 'loir', 'long', 'loof', 'look', 'loot', 'lore', 'loss', 'lots', 'loup', 'love', 'luce', 'ludo', 'luke', 'lulu', 'lure', 'lush', 'magi', 'maid', 'main', 'mako', 'male', 'mana', 'many', 'mart', 'mash', 'mast', 'mate', 'math', 'mats', 'matt', 'maul', 'maya', 'mays', 'meal', 'mean', 'meed', 'mela', 'mene', 'mere', 'merk', 'mesh', 'mete', 'mice', 'milo', 'mime', 'mina', 'mine', 'mirk', 'miss', 'mobs', 'moit', 'mold', 'molt', 'mome', 'moms', 'monk', 'moot', 'mope', 'more', 'morn', 'mows', 'moxa', 'much', 'mung', 'mush', 'muss', 'myth', 'name', 'nard', 'nark', 'nave', 'navy', 'neck', 'newt', 'nibs', 'nims', 'nine', 'nock', 'noil', 'noma', 'nosh', 'nowt', 'nuke', 'oafs', 'oast', 'oats', 'obit', 'odor', 'okra', 'omer', 'oner', 'ones', 'orcs', 'ords', 'orfe', 'orle', 'ossa', 'outs', 'over', 'owls', 'pail', 'pall', 'palp', 'pams', 'pang', 'pans', 'pant', 'paps', 'pate', 'pats', 'paws', 'pear', 'peba', 'pech', 'pecs', 'peel', 'peer', 'pees', 'pein', 'peri', 'phon', 'pice', 'pita', 'pith', 'play', 'plop', 'plot', 'plow', 'plug', 'plum', 'polo', 'pomp', 'pond', 'pons', 'pony', 'poof', 'pope', 'poss', 'pots', 'pour', 'prad', 'prat', 'prep', 'prob', 'prof', 'prow', 'puck', 'puds', 'puke', 'puku', 'pump', 'puns', 'pupa', 'purl', 'pyre', 'quad', 'quay', 'quey', 'quiz', 'raid', 'rail', 'rain', 'raja', 'rale', 'rams', 'rand', 'rant', 'raps', 'rasp', 'razz', 'rede', 'reef', 'reif', 'rein', 'repp', 'rial', 'ribs', 'rick', 'rift', 'rill', 'rime', 'rims', 'ring', 'rins', 'rise', 'rite', 'rits', 'roam', 'robe', 'rods', 'roma', 'rook', 'rort', 'rotl', 'roup', 'roux', 'rube', 'rubs', 'ruby', 'rues', 'rugs', 'ruin', 'runs', 'ryas', 'sack', 'sacs', 'saga', 'sail', 'sale', 'salp', 'salt', 'sand', 'sang', 'sash', 'saut', 'says', 'scab', 'scow', 'scud', 'scup', 'scut', 'seal', 'seam', 'sech', 'seed', 'seep', 'seer', 'self', 'sena', 'send', 'sera', 'sere', 'shad', 'shah', 'sham', 'shay', 'shes', 'ship', 'shoe', 'sick', 'sida', 'sign', 'sike', 'sima', 'sine', 'sing', 'sinh', 'sink', 'sins', 'site', 'size', 'skat', 'skin', 'skip', 'skis', 'slaw', 'sled', 'slew', 'sley', 'slob', 'slue', 'slug', 'smut', 'snap', 'snib', 'snip', 'snob', 'snog', 'snot', 'snow', 'snub', 'snug', 'soft', 'soja', 'soke', 'song', 'sons', 'sook', 'sorb', 'sori', 'souk', 'soul', 'sous', 'soya', 'spit', 'stay', 'stew', 'stir', 'stob', 'stud', 'suds', 'suer', 'suit', 'sumo', 'sums', 'sups', 'suqs', 'suss', 'sway', 'syce', 'synd', 'taal', 'tach', 'taco', 'tads', 'taka', 'tale', 'tamp', 'tams', 'tang', 'tans', 'tape', 'tare', 'taro', 'tarp', 'tart', 'tass', 'taus', 'teat', 'teds', 'teff', 'tegu', 'tell', 'term', 'thar', 'thaw', 'tics', 'tier', 'tiff', 'tils', 'tilt', 'tint', 'tipi', 'tire', 'tirl', 'toby', 'tods', 'toea', 'toff', 'toga', 'toil', 'toke', 'tola', 'tole', 'tomb', 'toms', 'torc', 'tors', 'tort', 'tosh', 'tote', 'tret', 'trey', 'trio', 'trug', 'tuck', 'tugs', 'tule', 'tune', 'tuns', 'tuts', 'tyke', 'tyne', 'typo', 'ulna', 'umbo', 'unau', 'unit', 'upas', 'user', 'uvea', 'vacs', 'vane', 'vang', 'vans', 'vara', 'vase', 'veep', 'veer', 'vega', 'veil', 'vela', 'vent', 'vies', 'view', 'vina', 'vine', 'vise', 'vlei', 'volt', 'vows', 'wads', 'waft', 'wage', 'wain', 'walk', 'want', 'wart', 'wave', 'waws', 'weal', 'wean', 'weds', 'weep', 'weft', 'weir', 'weka', 'weld', 'wens', 'weys', 'whap', 'whey', 'whin', 'whit', 'whop', 'wide', 'wife', 'wind', 'wine', 'wino', 'wins', 'wire', 'wise', 'woes', 'wont', 'wool', 'work', 'worm', 'wort', 'yack', 'yank', 'yapp', 'yard', 'yate', 'yawl', 'yegg', 'yell', 'yeuk', 'yews', 'yips', 'yobs', 'yogi', 'yoke', 'yolk', 'yoni', 'zack', 'zags', 'zest', 'zhos', 'zigs', 'zila', 'zips', 'ziti', 'zoea', 'zone', 'zoon') # noqa: E501, Q000, N806 + ADJECTIVES = ('about', 'above', 'abuzz', 'acerb', 'acold', 'acred', 'added', 'addle', 'adept', 'adult', 'adunc', 'adust', 'afoul', 'after', 'agape', 'agaze', 'agile', 'aging', 'agley', 'aglow', 'ahead', 'ahull', 'aided', 'alary', 'algal', 'alike', 'alive', 'alone', 'aloof', 'alpha', 'amber', 'amiss', 'amort', 'ample', 'amuck', 'angry', 'anile', 'apeak', 'apish', 'arced', 'areal', 'armed', 'aroid', 'ashen', 'aspen', 'astir', 'atilt', 'atrip', 'aulic', 'aural', 'awash', 'awful', 'awing', 'awned', 'axile', 'azoic', 'azure', 'baggy', 'baked', 'balky', 'bally', 'balmy', 'banal', 'bandy', 'bardy', 'bared', 'barer', 'barky', 'basal', 'based', 'baser', 'basic', 'batty', 'bawdy', 'beady', 'beaky', 'beamy', 'beaut', 'beefy', 'beery', 'beige', 'bendy', 'bifid', 'bijou', 'biped', 'birch', 'bitty', 'blame', 'bland', 'blank', 'blear', 'blest', 'blind', 'blond', 'blown', 'blowy', 'bluer', 'bluff', 'blunt', 'boned', 'bonny', 'boozy', 'bored', 'boric', 'bosky', 'bosom', 'bound', 'bovid', 'bowed', 'boxed', 'braky', 'brash', 'brief', 'briny', 'brisk', 'broad', 'broch', 'brood', 'brown', 'brute', 'buggy', 'bulgy', 'bumpy', 'burly', 'burnt', 'burry', 'bushy', 'busty', 'butch', 'buxom', 'cadgy', 'cagey', 'calmy', 'campy', 'canny', 'caped', 'cased', 'catty', 'cauld', 'cedar', 'cered', 'ceric', 'chary', 'cheap', 'cheek', 'chewy', 'chief', 'chill', 'chirk', 'choky', 'cissy', 'civil', 'cleft', 'coaly', 'color', 'comfy', 'comic', 'compo', 'conic', 'couth', 'coxal', 'crack', 'crank', 'crash', 'crass', 'crisp', 'cronk', 'cross', 'crude', 'cruel', 'crumb', 'cured', 'curly', 'curst', 'cushy', 'cutty', 'cynic', 'dated', 'dazed', 'dedal', 'deism', 'diazo', 'dicey', 'dingy', 'direr', 'dirty', 'dishy', 'dizzy', 'dolce', 'doped', 'dopey', 'dormy', 'dorty', 'dosed', 'dotal', 'dotty', 'dowdy', 'dowie', 'downy', 'dozen', 'drawn', 'dread', 'drear', 'dress', 'dried', 'ducky', 'duddy', 'dummy', 'dumpy', 'duple', 'dural', 'dusky', 'dusty', 'dutch', 'dying', 'eager', 'eaten', 'ebony', 'edged', 'eerie', 'eight', 'elder', 'elect', 'elfin', 'elite', 'empty', 'enate', 'enemy', 'epoxy', 'erect', 'ethic', 'every', 'extra', 'faced', 'faery', 'faint', 'famed', 'fancy', 'farci', 'fatal', 'fated', 'fatty', 'fazed', 'felon', 'fenny', 'ferny', 'fetal', 'fetid', 'fewer', 'fiery', 'fifty', 'filar', 'filmy', 'final', 'fined', 'finer', 'finny', 'fired', 'first', 'fishy', 'fixed', 'fizzy', 'flaky', 'flamy', 'flash', 'flawy', 'fleet', 'flory', 'flown', 'fluid', 'fluky', 'flush', 'focal', 'foggy', 'folio', 'forky', 'forte', 'forty', 'found', 'frail', 'frank', 'freed', 'freer', 'fresh', 'fried', 'front', 'frore', 'fuggy', 'funky', 'funny', 'furry', 'fusil', 'fussy', 'fuzzy', 'gabby', 'gamer', 'gamey', 'gamic', 'gammy', 'garni', 'gauge', 'gaunt', 'gauzy', 'gawky', 'gawsy', 'gemmy', 'genal', 'genic', 'ghast', 'gimpy', 'girly', 'glare', 'glary', 'glial', 'glued', 'gluey', 'godly', 'gooey', 'goofy', 'goosy', 'gouty', 'grade', 'grand', 'grapy', 'grave', 'gross', 'group', 'gruff', 'guest', 'gules', 'gulfy', 'gummy', 'gushy', 'gusty', 'gutsy', 'gutta', 'gypsy', 'gyral', 'hadal', 'hammy', 'handy', 'hardy', 'hasty', 'hated', 'hazel', 'heady', 'heapy', 'hefty', 'heigh', 'hempy', 'herby', 'hexed', 'hi-fi', 'hilly', 'hired', 'holey', 'honey', 'hooly', 'hoven', 'huger', 'hulky', 'humid', 'hunky', 'hyoid', 'idled', 'iliac', 'inane', 'incog', 'inert', 'inner', 'inter', 'iodic', 'ionic', 'irate', 'irony', 'itchy', 'jaggy', 'jammy', 'japan', 'jazzy', 'jerky', 'jetty', 'joint', 'jowly', 'juicy', 'jumpy', 'jural', 'kacha', 'kaput', 'kempt', 'keyed', 'kinky', 'known', 'kooky', 'kraal', 'laced', 'laigh', 'lairy', 'lamer', 'lardy', 'larky', 'lated', 'later', 'lathy', 'leady', 'leafy', 'leaky', 'leary', 'least', 'ledgy', 'leery', 'legal', 'leggy', 'lento', 'level', 'licht', 'licit', 'liege', 'light', 'liked', 'liney', 'lippy', 'lived', 'livid', 'loamy', 'loath', 'lobar', 'local', 'loony', 'loose', 'loral', 'losel', 'lousy', 'loved', 'lower', 'lowly', 'lowse', 'loyal', 'lucid', 'lucky', 'lumpy', 'lunar', 'lurid', 'lushy', 'lying', 'lyric', 'macho', 'macro', 'magic', 'major', 'malar', 'mangy', 'manky', 'manly', 'mardy', 'massy', 'mated', 'matte', 'mauve', 'mazed', 'mealy', 'meaty', 'medal', 'melic', 'mesic', 'mesne', 'messy', 'metal', 'miffy', 'milky', 'mined', 'minim', 'minor', 'minus', 'mired', 'mirky', 'misty', 'mixed', 'modal', 'model', 'moire', 'molar', 'moldy', 'moody', 'moony', 'mopey', 'moral', 'mossy', 'mothy', 'motor', 'mousy', 'moved', 'mucid', 'mucky', 'muddy', 'muggy', 'muley', 'mural', 'murky', 'mushy', 'muted', 'muzzy', 'myoid', 'naggy', 'naive', 'naked', 'named', 'nasty', 'natal', 'naval', 'nervy', 'newsy', 'nicer', 'niffy', 'nifty', 'ninth', 'nitty', 'nival', 'noble', 'nodal', 'noisy', 'non-U', 'north', 'nosed', 'noted', 'nowed', 'nubby', 'oaken', 'oared', 'oaten', 'obese', 'ocher', 'ochre', 'often', 'ohmic', 'oiled', 'olden', 'older', 'oleic', 'olive', 'optic', 'ortho', 'osmic', 'other', 'outer', 'ovoid', 'owing', 'owned', 'paced', 'pagan', 'paled', 'paler', 'pally', 'paper', 'pappy', 'parky', 'party', 'pasty', 'pavid', 'pawky', 'peaky', 'pearl', 'peart', 'peaty', 'pedal', 'peppy', 'perdu', 'perky', 'pesky', 'phony', 'piano', 'picky', 'piled', 'piney', 'pious', 'pique', 'pithy', 'platy', 'plump', 'plush', 'podgy', 'potty', 'power', 'prest', 'pricy', 'prima', 'prime', 'print', 'privy', 'prize', 'prone', 'proof', 'prosy', 'proud', 'proxy', 'pseud', 'pucka', 'pudgy', 'puffy', 'pukka', 'pupal', 'purer', 'pursy', 'pushy', 'pyoid', 'quack', 'quare', 'quasi', 'quiet', 'quits', 'rabic', 'rabid', 'radio', 'raked', 'randy', 'rapid', 'rarer', 'raspy', 'rathe', 'ratty', 'ready', 'reedy', 'reeky', 'refer', 'regal', 'riant', 'ridgy', 'right', 'riled', 'rimed', 'rindy', 'risen', 'risky', 'ritzy', 'rival', 'riven', 'robed', 'rocky', 'roily', 'roman', 'rooky', 'ropey', 'round', 'rowdy', 'ruddy', 'ruled', 'rummy', 'runic', 'runny', 'runty', 'rural', 'rusty', 'rutty', 'sable', 'salic', 'sandy', 'sappy', 'sarky', 'sassy', 'sated', 'saved', 'savvy', 'scald', 'scaly', 'scary', 'score', 'scrap', 'sedgy', 'seely', 'seral', 'sewed', 'shaky', 'sharp', 'sheen', 'shier', 'shill', 'shoal', 'shock', 'shoed', 'shore', 'short', 'shyer', 'silky', 'silly', 'silty', 'sixth', 'sixty', 'skint', 'slack', 'slant', 'sleek', 'slier', 'slimy', 'slung', 'small', 'smart', 'smoky', 'snaky', 'sneak', 'snide', 'snowy', 'snuff', 'so-so', 'soapy', 'sober', 'socko', 'solar', 'soled', 'solid', 'sonic', 'sooth', 'sooty', 'soppy', 'sorer', 'sound', 'soupy', 'spent', 'spicy', 'spiky', 'spiny', 'spiry', 'splay', 'split', 'sport', 'spumy', 'squat', 'staid', 'stiff', 'still', 'stoic', 'stone', 'stony', 'store', 'stout', 'straw', 'stray', 'strip', 'stung', 'suave', 'sudsy', 'sulfa', 'sulky', 'sunny', 'super', 'sural', 'surer', 'surfy', 'surgy', 'surly', 'swell', 'swept', 'swish', 'sworn', 'tabby', 'taboo', 'tacit', 'tacky', 'tamed', 'tamer', 'tangy', 'taped', 'tarot', 'tarry', 'tasty', 'tatty', 'taunt', 'tawie', 'teary', 'techy', 'telic', 'tenor', 'tense', 'tenth', 'tenty', 'tepid', 'terse', 'testy', 'third', 'tidal', 'tight', 'tiled', 'timid', 'tinct', 'tined', 'tippy', 'tipsy', 'tonal', 'toned', 'tonic', 'toric', 'total', 'tough', 'toxic', 'trade', 'treed', 'treen', 'trial', 'truer', 'tubal', 'tubby', 'tumid', 'tuned', 'tutti', 'twill', 'typal', 'typed', 'typic', 'umber', 'unapt', 'unbid', 'uncut', 'undue', 'undug', 'unfed', 'unfit', 'union', 'unlet', 'unmet', 'unwed', 'unwet', 'upper', 'upset', 'urban', 'utile', 'uveal', 'vagal', 'valid', 'vapid', 'varus', 'vatic', 'veiny', 'vital', 'vivid', 'vocal', 'vogie', 'volar', 'vying', 'wacky', 'wally', 'waney', 'warty', 'washy', 'waspy', 'waste', 'waugh', 'waxen', 'webby', 'wedgy', 'weeny', 'weepy', 'weest', 'weird', 'welsh', 'wersh', 'whist', 'white', 'whity', 'whole', 'wider', 'wight', 'winey', 'wired', 'wised', 'wiser', 'withy', 'wonky', 'woods', 'woozy', 'world', 'wormy', 'worse', 'worst', 'woven', 'wrath', 'wrier', 'wrong', 'wroth', 'xeric', 'yarer', 'yolky', 'young', 'yucky', 'yummy', 'zesty', 'zingy', 'zinky', 'zippy', 'zonal') # noqa: E501, Q000, N806 # fmt: on while True: adjective = random.choice(ADJECTIVES) # nosec B311 diff --git a/dvc/repo/fetch.py b/dvc/repo/fetch.py index f425cd743..75acadb2e 100644 --- a/dvc/repo/fetch.py +++ b/dvc/repo/fetch.py @@ -19,7 +19,7 @@ logger = logging.getLogger(__name__) @locked -def fetch( # noqa: C901 +def fetch( # noqa: C901, PLR0913 self, targets=None, jobs=None, diff --git a/dvc/repo/gc.py b/dvc/repo/gc.py index 96597388d..d2a62b7a3 100644 --- a/dvc/repo/gc.py +++ b/dvc/repo/gc.py @@ -23,7 +23,7 @@ def _validate_args(**kwargs): @locked -def gc( +def gc( # noqa: PLR0913 self: "Repo", all_branches: bool = False, cloud: bool = False, diff --git a/dvc/repo/graph.py b/dvc/repo/graph.py index 1f3dc9e81..34aecd25d 100644 --- a/dvc/repo/graph.py +++ b/dvc/repo/graph.py @@ -33,10 +33,10 @@ def get_pipeline(pipelines, node): return found[0] -def get_pipelines(G: "DiGraph"): +def get_pipelines(graph: "DiGraph"): import networkx as nx - return [G.subgraph(c).copy() for c in nx.weakly_connected_components(G)] + return [graph.subgraph(c).copy() for c in nx.weakly_connected_components(graph)] def collect_pipeline(stage: "Stage", graph: "DiGraph") -> Iterator["Stage"]: @@ -97,7 +97,7 @@ def build_graph(stages, outs_trie=None): from .trie import build_outs_trie - G = nx.DiGraph() + graph = nx.DiGraph() # Use trie to efficiently find overlapping outs and deps outs_trie = outs_trie or build_outs_trie(stages) @@ -108,7 +108,7 @@ def build_graph(stages, outs_trie=None): raise StagePathAsOutputError(stage, str(out)) # Building graph - G.add_nodes_from(stages) + graph.add_nodes_from(stages) for stage in stages: for dep in stage.deps: if dep.fs_path is None: @@ -119,10 +119,10 @@ def build_graph(stages, outs_trie=None): if outs_trie.has_subtrie(dep_key): overlapping.extend(outs_trie.values(prefix=dep_key)) - G.add_edges_from((stage, out.stage) for out in overlapping) - check_acyclic(G) + graph.add_edges_from((stage, out.stage) for out in overlapping) + check_acyclic(graph) - return G + return graph # NOTE: using stage graph instead of just list of stages to make sure that it @@ -131,9 +131,9 @@ def build_graph(stages, outs_trie=None): def build_outs_graph(graph, outs_trie): import networkx as nx - G = nx.DiGraph() + outs_graph = nx.DiGraph() - G.add_nodes_from(outs_trie.values()) + outs_graph.add_nodes_from(outs_trie.values()) for stage in graph.nodes(): for dep in stage.deps: if dep.fs_path is None: @@ -145,5 +145,5 @@ def build_outs_graph(graph, outs_trie): overlapping.extend(outs_trie.values(prefix=dep_key)) for from_out in stage.outs: - G.add_edges_from((from_out, out) for out in overlapping) - return G + outs_graph.add_edges_from((from_out, out) for out in overlapping) + return outs_graph diff --git a/dvc/repo/imp_url.py b/dvc/repo/imp_url.py index fc6445cac..1f3d03e23 100644 --- a/dvc/repo/imp_url.py +++ b/dvc/repo/imp_url.py @@ -14,7 +14,7 @@ from . import locked @locked @scm_context -def imp_url( # noqa: C901 +def imp_url( # noqa: C901, PLR0913 self: "Repo", url, out=None, diff --git a/dvc/repo/metrics/show.py b/dvc/repo/metrics/show.py index cfa1e2550..fe9bd968e 100644 --- a/dvc/repo/metrics/show.py +++ b/dvc/repo/metrics/show.py @@ -143,7 +143,7 @@ def show( except (SCMError, NoSCMError): # SCMError - detached head # NoSCMError - no repo case - pass # noqa: S110 + pass else: if res.get("workspace") == res.get(active_branch): res.pop("workspace", None) diff --git a/dvc/repo/move.py b/dvc/repo/move.py index 5806fbc08..299858037 100644 --- a/dvc/repo/move.py +++ b/dvc/repo/move.py @@ -32,11 +32,11 @@ def move(self, from_path, to_path): It only works with outputs generated by `add` or `import`, also known as data sources. """ - import dvc.output as Output + from dvc import output from dvc.dvcfile import DVC_FILE_SUFFIX from dvc.stage import Stage - from_out = Output.loads_from(Stage(self), [from_path])[0] + from_out = output.loads_from(Stage(self), [from_path])[0] assert from_out.protocol == "local" to_path = _expand_target_path(from_path, to_path) @@ -71,7 +71,7 @@ def move(self, from_path, to_path): else: to_path = os.path.relpath(to_path, stage.wdir) - to_out = Output.loads_from(stage, [to_path], out.use_cache, out.metric)[0] + to_out = output.loads_from(stage, [to_path], out.use_cache, out.metric)[0] out.move(to_out) stage.save() diff --git a/dvc/repo/params/show.py b/dvc/repo/params/show.py index 2268623b9..22bab2ae0 100644 --- a/dvc/repo/params/show.py +++ b/dvc/repo/params/show.py @@ -153,7 +153,7 @@ def show( except (SCMError, NoSCMError): # SCMError - detached head # NoSCMError - no repo case - pass # noqa: S110 + pass else: if res.get("workspace") == res.get(active_branch): res.pop("workspace", None) diff --git a/dvc/repo/pull.py b/dvc/repo/pull.py index e1556bb71..93ae72f6c 100644 --- a/dvc/repo/pull.py +++ b/dvc/repo/pull.py @@ -11,7 +11,7 @@ logger = logging.getLogger(__name__) @locked -def pull( +def pull( # noqa: PLR0913 self, targets=None, jobs=None, diff --git a/dvc/repo/push.py b/dvc/repo/push.py index f44a9b8ef..cd4a806c2 100644 --- a/dvc/repo/push.py +++ b/dvc/repo/push.py @@ -13,7 +13,7 @@ if TYPE_CHECKING: @locked -def push( # noqa: C901 +def push( # noqa: C901, PLR0913 self, targets=None, jobs=None, diff --git a/dvc/repo/reproduce.py b/dvc/repo/reproduce.py index 23aa63b04..df5df0389 100644 --- a/dvc/repo/reproduce.py +++ b/dvc/repo/reproduce.py @@ -129,7 +129,7 @@ def reproduce( # noqa: C901 def _reproduce_stages( # noqa: C901 - G, stages, downstream=False, single_item=False, on_unchanged=None, **kwargs + graph, stages, downstream=False, single_item=False, on_unchanged=None, **kwargs ): r"""Derive the evaluation of the given node for the given graph. @@ -166,7 +166,7 @@ def _reproduce_stages( # noqa: C901 The derived evaluation of _downstream_ B would be: [B, D, E] """ - steps = _get_steps(G, stages, downstream, single_item) + steps = _get_steps(graph, stages, downstream, single_item) force_downstream = kwargs.pop("force_downstream", False) result = [] @@ -222,16 +222,16 @@ def _reproduce_stages( # noqa: C901 return result -def _get_steps(G, stages, downstream, single_item): +def _get_steps(graph, stages, downstream, single_item): import networkx as nx - active = G.copy() + active = graph.copy() if not single_item: # NOTE: frozen stages don't matter for single_item - for stage in G: + for stage in graph: if stage.frozen: # NOTE: disconnect frozen stage from its dependencies - active.remove_edges_from(G.out_edges(stage)) + active.remove_edges_from(graph.out_edges(stage)) all_pipelines: List["Stage"] = [] for stage in stages: diff --git a/dvc/rwlock.py b/dvc/rwlock.py index a1fdb9388..ca4abe898 100644 --- a/dvc/rwlock.py +++ b/dvc/rwlock.py @@ -74,7 +74,7 @@ def _infos_to_str(infos): ) -def _check_blockers(tmp_dir, lock, info, *, mode, waiters): # noqa: C901 +def _check_blockers(tmp_dir, lock, info, *, mode, waiters): # noqa: C901, PLR0912 from .lock import LockError non_existing_pid = set() diff --git a/dvc/scm.py b/dvc/scm.py index 0c0c9e838..de68cd44b 100644 --- a/dvc/scm.py +++ b/dvc/scm.py @@ -227,7 +227,7 @@ def _get_n_commits(scm: "Git", revs: List[str], num: int) -> List[str]: return results -def iter_revs( # noqa: C901 +def iter_revs( scm: "Git", revs: Optional[List[str]] = None, num: int = 1, diff --git a/dvc/stage/__init__.py b/dvc/stage/__init__.py index 10d76157a..4d3b99075 100644 --- a/dvc/stage/__init__.py +++ b/dvc/stage/__init__.py @@ -140,7 +140,7 @@ class Stage(params.StageParams): # pylint:disable=no-value-for-parameter # rwlocked() confuses pylint - def __init__( + def __init__( # noqa: PLR0913 self, repo, path=None, diff --git a/dvc/stage/monitor.py b/dvc/stage/monitor.py index b703ea1fd..4a62e034e 100644 --- a/dvc/stage/monitor.py +++ b/dvc/stage/monitor.py @@ -29,7 +29,7 @@ class MonitorTask: raise NotImplementedError @property - def SIGNAL_FILE(self) -> str: + def SIGNAL_FILE(self) -> str: # noqa: N802 raise NotImplementedError @property diff --git a/dvc/ui/__init__.py b/dvc/ui/__init__.py index a261bcb1b..88c4a9430 100644 --- a/dvc/ui/__init__.py +++ b/dvc/ui/__init__.py @@ -87,7 +87,7 @@ class Console: styled=styled, ) - def write_json( + def write_json( # noqa: PLR0913 self, data: Any, indent: Optional[int] = None, diff --git a/dvc/utils/collections.py b/dvc/utils/collections.py index 9fd5696f8..2ef4a1410 100644 --- a/dvc/utils/collections.py +++ b/dvc/utils/collections.py @@ -14,8 +14,8 @@ def apply_diff(src, dest): # noqa: C901 Used in Stage load/dump cycle to preserve comments and custom formatting. """ - Seq = (list, tuple) - Container = (Mapping, list, tuple) + Seq = (list, tuple) # noqa: N806 + Container = (Mapping, list, tuple) # noqa: N806 def is_same_type(a, b): return any( diff --git a/dvc/utils/serialize/_py.py b/dvc/utils/serialize/_py.py index babed3589..3c470bb56 100644 --- a/dvc/utils/serialize/_py.py +++ b/dvc/utils/serialize/_py.py @@ -111,7 +111,7 @@ def _ast_tree_to_dict(tree, only_self_params=False, lineno=False): return result -def _ast_assign_to_dict(assign, only_self_params=False, lineno=False): +def _ast_assign_to_dict(assign, only_self_params=False, lineno=False): # noqa: PLR0912 result = {} if isinstance(assign, ast.AnnAssign): diff --git a/dvc/version.py b/dvc/version.py index 7ab488de1..d4f3b0faa 100644 --- a/dvc/version.py +++ b/dvc/version.py @@ -1,7 +1,7 @@ # pylint: disable=unused-import try: from ._dvc_version import version as __version__ - from ._dvc_version import version_tuple # noqa: F401 + from ._dvc_version import version_tuple except ImportError: __version__ = "UNKNOWN" version_tuple = (0, 0, __version__) # type: ignore[assignment] diff --git a/pyproject.toml b/pyproject.toml index db62dc7f1..24e83cb26 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -159,10 +159,10 @@ line_length = 88 [tool.ruff] target-version = "py38" show-source = true -ignore = ["S101", "PT004", "PT007", "PT019", "SIM105", "SIM108", "SIM110", "SIM111", "SIM117", "TRY003", "TRY200", "TRY300", "TRY301", "PLR0913", "PLR2004", "RUF005"] -select = ["F", "E", "W", "C90", "UP", "YTT", "S", "BLE", "B", "A", "C4", "T10", "ISC", "ICN", "G", "INP", "PIE", "T20", "PT", "Q", "RET501", "RET504", "SIM", "TID", "TCH", "ARG", "PGH", "PLC", "PLE", "PLR", "PLW", "TRY", "RUF"] +ignore = ["N818", "S101", "PT004", "PT007", "PT019", "SIM105", "SIM108", "SIM110", "SIM111", "SIM117", "TRY003", "TRY200", "TRY300", "TRY301", "PLR2004", "RUF005"] +select = ["F", "E", "W", "C90", "N", "UP", "YTT", "S", "BLE", "B", "A", "C4", "T10", "ISC", "ICN", "G", "INP", "PIE", "T20", "PT", "Q", "RET501", "RET504", "SIM", "TID", "TCH", "ARG", "PGH", "PLC", "PLE", "PLR", "PLW", "TRY", "RUF"] # external flake8 codes that should be preserved -external = ["B301", "B024", "C901", "E302", "F401", "W601"] +external = ["B301", "C901", "E302", "W601"] [tool.ruff.flake8-pytest-style] fixture-parentheses = false @@ -181,9 +181,19 @@ strict = true [tool.ruff.flake8-unused-arguments] ignore-variadic-names = true +[tool.ruff.isort] +known-first-party = ["dvc", "dvc_data", "dvc_objects", "dvc_render", "dvc_task", "tests"] + +[tool.ruff.pep8-naming] +ignore-names = ["M", "SCM"] + [tool.ruff.per-file-ignores] -"dvc/testing/*.py" = ["ARG002"] -"scripts/**/*.py" = ["T201", "INP001", "TRY002"] +"dvc/testing/**" = ["ARG002"] +"scripts/**" = ["T201", "INP001", "TRY002"] +"dvc/commands/**" = ["N806"] + +[tool.ruff.pylint] +max-args = 10 [tool.pytest.ini_options] log_level = "debug" diff --git a/tests/func/experiments/executor/test_ssh.py b/tests/func/experiments/executor/test_ssh.py index 4bf724831..79b734128 100644 --- a/tests/func/experiments/executor/test_ssh.py +++ b/tests/func/experiments/executor/test_ssh.py @@ -100,7 +100,7 @@ def test_init_cache(tmp_dir, dvc, scm, cloud): @pytest.mark.needs_internet @pytest.mark.parametrize("cloud", [pytest.lazy_fixture("git_ssh")]) def test_reproduce(tmp_dir, scm, dvc, cloud, exp_stage, mocker): - from sshfs import SSHFileSystem as _sshfs + from sshfs import SSHFileSystem as _sshfs # noqa: N813 rev = scm.get_rev() root_url = cloud / SSHExecutor.gen_dirname() diff --git a/tests/func/test_data_cloud.py b/tests/func/test_data_cloud.py index 42b23ab42..1f5e59ae5 100644 --- a/tests/func/test_data_cloud.py +++ b/tests/func/test_data_cloud.py @@ -15,7 +15,7 @@ from dvc_data.hashfile.db import HashFileDB from dvc_data.hashfile.db.local import LocalHashFileDB -def test_cloud_cli(tmp_dir, dvc, remote, mocker): +def test_cloud_cli(tmp_dir, dvc, remote, mocker): # noqa: PLR0915 jobs = 2 args = ["-v", "-j", str(jobs)] diff --git a/tests/func/test_diff.py b/tests/func/test_diff.py index 76ea03096..55555fce0 100644 --- a/tests/func/test_diff.py +++ b/tests/func/test_diff.py @@ -158,9 +158,9 @@ def test_refs(tmp_dir, scm, dvc): tmp_dir.dvc_gen("file", "second", commit="second version") tmp_dir.dvc_gen("file", "third", commit="third version") - HEAD_2 = digest("first") - HEAD_1 = digest("second") - HEAD = digest("third") + HEAD_2 = digest("first") # noqa: N806 + HEAD_1 = digest("second") # noqa: N806 + HEAD = digest("third") # noqa: N806 assert dvc.diff("HEAD~1") == { "added": [], diff --git a/tests/integration/plots/test_plots.py b/tests/integration/plots/test_plots.py index d0683911b..4a5c07d2e 100644 --- a/tests/integration/plots/test_plots.py +++ b/tests/integration/plots/test_plots.py @@ -97,11 +97,6 @@ def _remove_blanks(text: str): return " ".join(text.replace("\t", "").replace("\n", "").split()) -class hashabledict(dict): - def __hash__(self): - return hash(tuple(sorted(self.items()))) - - def verify_vega( versions, html_result, diff --git a/tests/unit/command/test_dag.py b/tests/unit/command/test_dag.py index e97561246..53750b982 100644 --- a/tests/unit/command/test_dag.py +++ b/tests/unit/command/test_dag.py @@ -60,35 +60,35 @@ def test_build(repo): def test_build_target(repo): - G = _build(repo, target="3") - assert set(G.nodes()) == {"3", "b.dvc", "a.dvc"} - assert set(G.edges()) == {("3", "a.dvc"), ("3", "b.dvc")} + graph = _build(repo, target="3") + assert set(graph.nodes()) == {"3", "b.dvc", "a.dvc"} + assert set(graph.edges()) == {("3", "a.dvc"), ("3", "b.dvc")} def test_build_target_with_outs(repo): - G = _build(repo, target="3", outs=True) - assert set(G.nodes()) == {"a", "b", "h", "i"} - assert set(G.edges()) == {("i", "a"), ("i", "b"), ("h", "a"), ("h", "b")} + graph = _build(repo, target="3", outs=True) + assert set(graph.nodes()) == {"a", "b", "h", "i"} + assert set(graph.edges()) == {("i", "a"), ("i", "b"), ("h", "a"), ("h", "b")} def test_build_granular_target_with_outs(repo): - G = _build(repo, target="h", outs=True) - assert set(G.nodes()) == {"a", "b", "h"} - assert set(G.edges()) == {("h", "a"), ("h", "b")} + graph = _build(repo, target="h", outs=True) + assert set(graph.nodes()) == {"a", "b", "h"} + assert set(graph.edges()) == {("h", "a"), ("h", "b")} def test_build_full(repo): - G = _build(repo, target="3", full=True) - assert nx.is_isomorphic(G, repo.index.graph) + graph = _build(repo, target="3", full=True) + assert nx.is_isomorphic(graph, repo.index.graph) # NOTE: granular or not, full outs DAG should be the same @pytest.mark.parametrize("granular", [True, False]) def test_build_full_outs(repo, granular): target = "h" if granular else "3" - G = _build(repo, target=target, outs=True, full=True) - assert set(G.nodes()) == {"j", "i", "d", "b", "g", "f", "e", "a", "h"} - assert set(G.edges()) == { + graph = _build(repo, target=target, outs=True, full=True) + assert set(graph.nodes()) == {"j", "i", "d", "b", "g", "f", "e", "a", "h"} + assert set(graph.edges()) == { ("d", "a"), ("e", "a"), ("f", "b"), diff --git a/tests/unit/command/test_plots.py b/tests/unit/command/test_plots.py index acd44ab67..d020bf78a 100644 --- a/tests/unit/command/test_plots.py +++ b/tests/unit/command/test_plots.py @@ -171,7 +171,7 @@ def test_plots_diff_open(tmp_dir, dvc, mocker, capsys, plots_data, auto_open): assert index_path.as_uri() in out -def test_plots_diff_open_WSL(tmp_dir, dvc, mocker, plots_data): +def test_plots_diff_open_wsl(tmp_dir, dvc, mocker, plots_data): mocked_open = mocker.patch("webbrowser.open", return_value=True) mocked_uname_result = mocker.MagicMock() mocked_uname_result.release = "microsoft" diff --git a/tests/unit/test_logger.py b/tests/unit/test_logger.py index d296863a7..5e14c1922 100644 --- a/tests/unit/test_logger.py +++ b/tests/unit/test_logger.py @@ -242,11 +242,11 @@ def test_add_existing_level(caplog, dt): # eg: # https://github.com/bokeh/bokeh/blob/04bb30fef2e72e64baaa8b2f330806d5bfdd3b11/ # bokeh/util/logconfig.py#L79-L85 - TRACE2 = 4 + TRACE2 = 4 # noqa: N806 logging.addLevelName(TRACE2, "TRACE2") logging.TRACE2 = TRACE2 - dvc.logger.addLoggingLevel("TRACE2", 2) + dvc.logger.add_logging_level("TRACE2", 2) # DVC sets all expected entrypoints, but doesn't override the level assert logging.TRACE2 == 4