Skip to content

Commit 13e034a

Browse files
authored
STY: Enable ruff's flynt, flake8-logging-format (#54607)
* Enable FLY checks * Enable FLY checks * Add logging format
1 parent 8d50940 commit 13e034a

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

pandas/io/formats/html.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ def write_style(self) -> None:
633633
else:
634634
element_props.append(("thead th", "text-align", "right"))
635635
template_mid = "\n\n".join(template_select % t for t in element_props)
636-
template = dedent("\n".join((template_first, template_mid, template_last)))
636+
template = dedent(f"{template_first}\n{template_mid}\n{template_last}")
637637
self.write(template)
638638

639639
def render(self) -> list[str]:

pandas/io/formats/string.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def __init__(self, fmt: DataFrameFormatter, line_width: int | None = None) -> No
2828
def to_string(self) -> str:
2929
text = self._get_string_representation()
3030
if self.fmt.should_show_dimensions:
31-
text = "".join([text, self.fmt.dimensions_info])
31+
text = f"{text}{self.fmt.dimensions_info}"
3232
return text
3333

3434
def _get_strcols(self) -> list[list[str]]:

pyproject.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ select = [
227227
# flake8-gettext
228228
"INT",
229229
# pylint
230-
"PLC", "PLE", "PLR", "PLW",
230+
"PL",
231231
# misc lints
232232
"PIE",
233233
# flake8-pyi
@@ -250,6 +250,10 @@ select = [
250250
"NPY002",
251251
# Perflint
252252
"PERF",
253+
# flynt
254+
"FLY",
255+
# flake8-logging-format
256+
"G",
253257
]
254258

255259
ignore = [
@@ -354,7 +358,7 @@ exclude = [
354358
"asv_bench/*" = ["TID", "NPY002"]
355359
# to be enabled gradually
356360
"pandas/core/*" = ["PLR5501"]
357-
"pandas/tests/*" = ["B028"]
361+
"pandas/tests/*" = ["B028", "FLY"]
358362
"scripts/*" = ["B028"]
359363
# Keep this one enabled
360364
"pandas/_typing.py" = ["TCH"]

scripts/tests/test_validate_docstrings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ def _import_path(self, klass=None, func=None):
110110
base_path = "scripts.tests.test_validate_docstrings"
111111

112112
if klass:
113-
base_path = ".".join([base_path, klass])
113+
base_path = f"{base_path}.{klass}"
114114

115115
if func:
116-
base_path = ".".join([base_path, func])
116+
base_path = f"{base_path}.{func}"
117117

118118
return base_path
119119

scripts/validate_docstrings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def get_api_items(api_doc_fd):
143143
func = getattr(func, part)
144144

145145
yield (
146-
".".join([current_module, line_stripped]),
146+
f"{current_module}.{line_stripped}",
147147
func,
148148
current_section,
149149
current_subsection,

0 commit comments

Comments
 (0)