Skip to content

Commit 67568b5

Browse files
AvasamAlexWaygood
andauthored
Enable some Ruff FURB rules (#13310)
Co-authored-by: Alex Waygood <[email protected]>
1 parent 4ce9f24 commit 67568b5

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

pyproject.toml

+10
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ select = [
4949
"E", # pycodestyle Error
5050
"F", # Pyflakes
5151
"W", # pycodestyle Warning
52+
# Most refurb rules are in preview and can be opinionated,
53+
# consider them individually as they come out of preview (last check: 0.8.4)
54+
"FURB105", # Unnecessary empty string passed to `print`
55+
"FURB129", # Instead of calling `readlines()`, iterate over file object directly
56+
"FURB136", # Replace `if` expression with `{min_max}` call
57+
"FURB167", # Use of regular expression alias `re.{}`
58+
"FURB168", # Prefer `is` operator over `isinstance` to check if an object is `None`
59+
"FURB169", # Compare the identities of `{object}` and None instead of their respective types
60+
"FURB177", # Prefer `Path.cwd()` over `Path().resolve()` for current-directory lookups
61+
"FURB187", # Use of assignment of `reversed` on list `{name}`
5262
# PYI: only enable rules that have autofixes and that we always want to fix (even manually),
5363
# avoids duplicate # noqa with flake8-pyi and flake8-noqa flagging `PYI` codes
5464
# See https://github.com/plinss/flake8-noqa/issues/22

scripts/create_baseline_stubs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def main() -> None:
218218
info = get_installed_package_info(project)
219219
if info is None:
220220
print(f'Error: "{project}" is not installed', file=sys.stderr)
221-
print("", file=sys.stderr)
221+
print(file=sys.stderr)
222222
print(f'Suggestion: Run "python3 -m pip install {project}" and try again', file=sys.stderr)
223223
sys.exit(1)
224224
project, version = info

0 commit comments

Comments
 (0)