Skip to content

Commit a89ea11

Browse files
lint: drop yesqa, covered with RUF100 (#19532)
* drop yesqa, covered with RUF100 * fixing * flaky test_snap_shotting * xfail test_lit_drive * flaky test_connect_disconnect_local --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 0520d94 commit a89ea11

File tree

18 files changed

+20
-31
lines changed

18 files changed

+20
-31
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,6 @@ repos:
7676
hooks:
7777
- id: sphinx-lint
7878

79-
- repo: https://github.com/asottile/yesqa
80-
rev: v1.5.0
81-
hooks:
82-
- id: yesqa
83-
name: Unused noqa
84-
additional_dependencies:
85-
#- pep8-naming
86-
- flake8-pytest-style
87-
- flake8-bandit
88-
- flake8-simplify
89-
- flake8-return
90-
9179
- repo: https://github.com/astral-sh/ruff-pre-commit
9280
rev: "v0.2.0"
9381
hooks:

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ lint.extend-select = [
6161
"SIM", # see: https://pypi.org/project/flake8-simplify
6262
"RET", # see: https://pypi.org/project/flake8-return
6363
"PT", # see: https://pypi.org/project/flake8-pytest-style
64+
"RUF100", # see: https://docs.astral.sh/ruff/rules/unused-noqa/
6465
]
6566
lint.ignore = [
6667
"E731", # Do not assign a lambda expression, use a def

src/lightning/app/cli/lightning_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def _run_app(
179179
) -> None:
180180
if not os.path.exists(file):
181181
original_file = file
182-
file = cmd_install.gallery_apps_and_components(file, True, "latest", overwrite=True) # type: ignore[assignment] # noqa E501
182+
file = cmd_install.gallery_apps_and_components(file, True, "latest", overwrite=True) # type: ignore[assignment] # E501
183183
if file is None:
184184
click.echo(f"The provided entrypoint `{original_file}` doesn't exist.")
185185
sys.exit(1)

src/lightning/app/core/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def get_lightning_cloud_url() -> str:
9494
ENABLE_UPLOAD_ENDPOINT = bool(int(os.getenv("ENABLE_UPLOAD_ENDPOINT", "1")))
9595

9696
# directory where system customization sync files stored
97-
SYS_CUSTOMIZATIONS_SYNC_ROOT = "/tmp/sys-customizations-sync" # noqa: S108 # todo
97+
SYS_CUSTOMIZATIONS_SYNC_ROOT = "/tmp/sys-customizations-sync" # todo
9898
# directory where system customization sync files will be copied to be packed into app tarball
9999
SYS_CUSTOMIZATIONS_SYNC_PATH = ".sys-customizations-sync"
100100

src/lightning/app/source_code/hashing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def _get_hash(files: List[str], algorithm: str = "blake2", chunk_num_blocks: int
3939
if algorithm == "blake2":
4040
h = hashlib.blake2b(digest_size=20)
4141
elif algorithm == "md5":
42-
h = hashlib.md5() # noqa: S324
42+
h = hashlib.md5()
4343
else:
4444
raise ValueError(f"Algorithm {algorithm} not supported")
4545

src/lightning/app/storage/path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def hash(self) -> Optional[str]:
134134
if self._origin is None:
135135
return None
136136
contents = f"{self.origin_name}/{self}"
137-
return hashlib.sha1(contents.encode("utf-8")).hexdigest() # noqa: S324
137+
return hashlib.sha1(contents.encode("utf-8")).hexdigest()
138138

139139
@property
140140
def parents(self) -> Sequence["Path"]:

src/lightning/app/storage/payload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def hash(self) -> Optional[str]:
6666
if self._origin is None:
6767
return None
6868
contents = f"{self.origin_name}/{self.consumer_name}/{self.name}"
69-
return hashlib.sha1(contents.encode("utf-8")).hexdigest() # noqa: S324
69+
return hashlib.sha1(contents.encode("utf-8")).hexdigest()
7070

7171
@property
7272
def origin_name(self) -> str:

src/lightning/app/utilities/login.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ async def stop_server_once_request_is_done():
189189

190190
if not token:
191191
logger.warn(
192-
"Login Failed. This is most likely because you're using an older version of the CLI. \n" # noqa E501
192+
"Login Failed. This is most likely because you're using an older version of the CLI. \n" # E501
193193
"Please try to update the CLI or open an issue with this information \n" # E501
194194
f"expected token in {request.query_params.items()}"
195195
)

src/lightning/fabric/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from lightning_utilities.core.imports import package_available
77

88
if os.path.isfile(os.path.join(os.path.dirname(__file__), "__about__.py")):
9-
from lightning.fabric.__about__ import * # noqa: F401, F403
9+
from lightning.fabric.__about__ import * # noqa: F403
1010
if os.path.isfile(os.path.join(os.path.dirname(__file__), "__version__.py")):
1111
from lightning.fabric.__version__ import version as __version__
1212
elif package_available("lightning"):

src/lightning/pytorch/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from lightning_utilities import module_available
77

88
if os.path.isfile(os.path.join(os.path.dirname(__file__), "__about__.py")):
9-
from lightning.pytorch.__about__ import * # noqa: F401, F403
9+
from lightning.pytorch.__about__ import * # noqa: F403
1010
if "__version__" not in locals():
1111
if os.path.isfile(os.path.join(os.path.dirname(__file__), "__version__.py")):
1212
from lightning.pytorch.__version__ import version as __version__

0 commit comments

Comments
 (0)