Skip to content

Commit

Permalink
Disable E501
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser committed Jan 21, 2025
1 parent 71021b3 commit f75b62f
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 65 deletions.
12 changes: 6 additions & 6 deletions crates/ruff_python_ast/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def write_owned_enum(out: list[str], groups: list[Group]) -> None:
""")
for node in group.nodes:
out.append(
f"""{group.owned_enum_ty}::{node.variant}(node) => node.visit_source_order(visitor),""" # noqa: E501
f"{group.owned_enum_ty}::{node.variant}(node) => node.visit_source_order(visitor),"
)
out.append("""
}
Expand Down Expand Up @@ -234,7 +234,7 @@ def write_ref_enum(out: list[str], groups: list[Group]) -> None:
""")
for node in group.nodes:
out.append(
f"""{group.owned_enum_ty}::{node.variant}(node) => {group.ref_enum_ty}::{node.variant}(node),""" # noqa: E501
f"{group.owned_enum_ty}::{node.variant}(node) => {group.ref_enum_ty}::{node.variant}(node),"
)
out.append("""
}
Expand Down Expand Up @@ -311,7 +311,7 @@ def write_anynoderef(out: list[str], groups: list[Group]) -> None:
""")
for node in group.nodes:
out.append(
f"""{group.owned_enum_ty}::{node.variant}(node) => AnyNodeRef::{node.name}(node),""" # noqa: E501
f"{group.owned_enum_ty}::{node.variant}(node) => AnyNodeRef::{node.name}(node),"
)
out.append("""
}
Expand All @@ -326,7 +326,7 @@ def write_anynoderef(out: list[str], groups: list[Group]) -> None:
""")
for node in group.nodes:
out.append(
f"""{group.ref_enum_ty}::{node.variant}(node) => AnyNodeRef::{node.name}(node),""" # noqa: E501
f"{group.ref_enum_ty}::{node.variant}(node) => AnyNodeRef::{node.name}(node),"
)
out.append("""
}
Expand Down Expand Up @@ -365,7 +365,7 @@ def write_anynoderef(out: list[str], groups: list[Group]) -> None:
for group in groups:
for node in group.nodes:
out.append(
f"""AnyNodeRef::{node.name}(node) => std::ptr::NonNull::from(*node).cast(),""" # noqa: E501
f"AnyNodeRef::{node.name}(node) => std::ptr::NonNull::from(*node).cast(),"
)
out.append("""
}
Expand All @@ -385,7 +385,7 @@ def write_anynoderef(out: list[str], groups: list[Group]) -> None:
for group in groups:
for node in group.nodes:
out.append(
f"""AnyNodeRef::{node.name}(node) => node.visit_source_order(visitor),""" # noqa: E501
f"AnyNodeRef::{node.name}(node) => node.visit_source_order(visitor),"
)
out.append("""
}
Expand Down
6 changes: 3 additions & 3 deletions crates/ruff_python_formatter/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def to_camel_case(node: str) -> str:
write!(f, [verbatim_text(item)])
}}
}}
""".strip() # noqa: E501
""".strip()

node_path.write_text(rustfmt(code))

Expand All @@ -128,7 +128,7 @@ def to_camel_case(node: str) -> str:
use ruff_formatter::{FormatOwnedWithRule, FormatRefWithRule, FormatResult, FormatRule};
use ruff_python_ast as ast;
""" # noqa: E501
"""
for node in nodes:
text = f"""
impl FormatRule<ast::{node}, PyFormatContext<'_>>
Expand Down Expand Up @@ -170,7 +170,7 @@ def to_camel_case(node: str) -> str:
)
}}
}}
""" # noqa: E501
"""
generated += text

out.write_text(rustfmt(generated))
111 changes: 56 additions & 55 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@ readme = "README.md"
requires-python = ">=3.7"
license = { file = "LICENSE" }
keywords = [
"automation",
"flake8",
"pycodestyle",
"pyflakes",
"pylint",
"clippy",
"automation",
"flake8",
"pycodestyle",
"pyflakes",
"pylint",
"clippy",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Rust",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Quality Assurance",
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Rust",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Quality Assurance",
]

[project.urls]
Expand All @@ -50,45 +50,46 @@ module-name = "ruff"
python-source = "python"
strip = true
exclude = [
"crates/ruff_linter/resources/test/fixtures/**/*",
"crates/ruff_linter/src/rules/*/snapshots/**/*"
"crates/ruff_linter/resources/test/fixtures/**/*",
"crates/ruff_linter/src/rules/*/snapshots/**/*"
]
include = [
"rust-toolchain.toml"
"rust-toolchain.toml"
]

[tool.ruff]
target-version = "py38"
extend-exclude = [
"crates/red_knot_vendored/vendor/",
"crates/ruff/resources/",
"crates/ruff_linter/resources/",
"crates/ruff_python_formatter/resources/",
"crates/ruff_python_parser/resources/"
"crates/red_knot_vendored/vendor/",
"crates/ruff/resources/",
"crates/ruff_linter/resources/",
"crates/ruff_python_formatter/resources/",
"crates/ruff_python_parser/resources/"
]

[tool.ruff.lint]
select = [
"E", # pycodestyle (error)
"F", # pyflakes
"B", # bugbear
"B9",
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
"I", # isort
"UP", # pyupgrade
"PIE", # flake8-pie
"PGH", # pygrep-hooks
"PYI", # flake8-pyi
"RUF",
"E", # pycodestyle (error)
"F", # pyflakes
"B", # bugbear
"B9",
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
"I", # isort
"UP", # pyupgrade
"PIE", # flake8-pie
"PGH", # pygrep-hooks
"PYI", # flake8-pyi
"RUF",
]

ignore = [
# Conflicts with the formatter
"COM812",
# only relevant if you run a script with `python -0`,
# which seems unlikely for any of the scripts in this repo
"B011",
# only relevant if you run a script with `python -0`,
# which seems unlikely for any of the scripts in this repo
"B011",
# Leave it to the formatter to split long lines and
# the judgement of all of us.
"E501"
]

[tool.ruff.lint.isort]
Expand Down Expand Up @@ -131,11 +132,11 @@ changelog_sections.__unknown__ = "Other changes"
changelog_contributors = false

version_files = [
"README.md",
"docs/integrations.md",
"docs/tutorial.md",
"crates/ruff/Cargo.toml",
"crates/ruff_linter/Cargo.toml",
"crates/ruff_wasm/Cargo.toml",
"scripts/benchmarks/pyproject.toml",
"README.md",
"docs/integrations.md",
"docs/tutorial.md",
"crates/ruff/Cargo.toml",
"crates/ruff_linter/Cargo.toml",
"crates/ruff_wasm/Cargo.toml",
"scripts/benchmarks/pyproject.toml",
]
2 changes: 1 addition & 1 deletion scripts/check_ecosystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ async def limited_parallelism(coroutine: T) -> T:

if matches is None:
# Handle case where there are no regex matches e.g.
# + "?application=AIRFLOW&authenticator=TEST_AUTH&role=TEST_ROLE&warehouse=TEST_WAREHOUSE" # noqa: E501
# + "?application=AIRFLOW&authenticator=TEST_AUTH&role=TEST_ROLE&warehouse=TEST_WAREHOUSE"
# Which was found in local testing
continue

Expand Down

0 comments on commit f75b62f

Please sign in to comment.