From 8a9047d1bddb5794ddb56ac759794658d53f4874 Mon Sep 17 00:00:00 2001 From: Moe bot Date: Thu, 18 May 2023 13:57:18 -0700 Subject: [PATCH] build: upgrade lint dependencies --- moe/library/extra.py | 6 +++++- moe/library/track.py | 2 +- moe/move/move_core.py | 2 +- pyproject.toml | 12 ++++++------ setup.cfg | 21 ++++++++++++++------- 5 files changed, 27 insertions(+), 16 deletions(-) diff --git a/moe/library/extra.py b/moe/library/extra.py index 854543fa..3f958347 100644 --- a/moe/library/extra.py +++ b/moe/library/extra.py @@ -157,7 +157,11 @@ def __repr__(self): for field in self.fields - omit_fields: if hasattr(self, field): field_reprs.append(f"{field}={getattr(self, field)!r}") - repr_str = "Extra(" + ", ".join(field_reprs) + f", album='{self.album}'" + repr_str = ( + "Extra(" + + ", ".join(field_reprs) + + f", album='{self.album}'" # noqa: B907 album repr is too long + ) custom_field_reprs = [] for custom_field, value in self.custom.items(): diff --git a/moe/library/track.py b/moe/library/track.py index 59f0bbfe..4103ccee 100644 --- a/moe/library/track.py +++ b/moe/library/track.py @@ -254,7 +254,7 @@ def __repr__(self): repr_str = ( f"{type(self).__name__}(" + ", ".join(field_reprs) - + f", album='{self.album}'" + + f", album='{self.album}'" # noqa: B907 album repr is too long ) custom_field_reprs = [] diff --git a/moe/move/move_core.py b/moe/move/move_core.py index 07248d0c..bdb05eec 100644 --- a/moe/move/move_core.py +++ b/moe/move/move_core.py @@ -187,7 +187,7 @@ def _lazy_fstr_item(template: str, lib_item: LibItem) -> str: for func in funcs: globals()[func.__name__] = func - return eval(f'f"""{template}"""') + return eval(f'f"""{template}"""') # noqa: B907 def _sanitize_path_part(path_part: str) -> str: diff --git a/pyproject.toml b/pyproject.toml index 9905413c..0ad62a70 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,12 +36,12 @@ pytest-cov = "^4.0.0" tox = "^4.0.0" [tool.poetry.group.lint.dependencies] -black = "^22.6.0" -commitizen = "^2.17.12" +black = "^23.0.0" +commitizen = "^3.0.0" darglint = "^1.8.1" -flake8 = "^5.0.4" -flake8-alphabetize = "^0.0.17" -flake8-bugbear = "^22.7.1" +flake8 = "^6.0.0" +flake8-alphabetize = "^0.0.19" +flake8-bugbear = "^23.0.0" flake8-comprehensions = "^3.10.0" flake8-docstrings = "^1.5.0" flake8-pytest-style = "^1.6.0" @@ -49,7 +49,7 @@ flake8-use-fstring = "^1.1" "github3.py" = "^3.2.0" isort = "^5.10.1" mccabe = "^0.7.0" -pre-commit = "^2.6.0" +pre-commit = "^3.0.0" pyright = "^1.1.267" [tool.poetry.group.docs.dependencies] diff --git a/setup.cfg b/setup.cfg index 58a50a2a..4298a818 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,22 +21,29 @@ select = PT, # pytest style W6, # pycodestyle deprecation warnings ignore = - PT001, # allow `@pytest.fixture` (no parens) - PT023, # allow `@pytest.mark.foo` (no parens) - B950, # bug-bear line length; just use flake8 line length limit - E203, # whitespace before ':' (black conflict) - DAR402, # Excess exceptions in "Raises" (I like to document sub-private-methods) - E266, # too many leading '#' for block comment + # allow `@pytest.fixture` (no parens) + PT001, + # allow `@pytest.mark.foo` (no parens) + PT023, + # bug-bear line length; just use flake8 line length limit + B950, + # whitespace before ':' (black conflict) + E203, + # Excess exceptions in "Raises" (I like to document sub-private-methods) + DAR402, + # too many leading '#' for block comment + E266, per-file-ignores = # E800: config file has commented out code as examples alembic/env.py:E800 # D1: database migrations don't need docstrings # I: isort errors tend to misinterpret alembic as a local package alembic/versions/*.py:D1,I + # B907: manually specified quotes are usually intentional for testing purposes # C901: don't check complexity for tests # DAR101: pytest uses fixtures as arguments, documenting each use is unnecessary # DAR102: factory arguments with fixtures can be weird - tests/*:C901,DAR101,DAR102 + tests/*:B907,C901,DAR101,DAR102 # F401: import unused # F403: allow * imports (used for packaging in some cases) */__init__.py:F401,F403