Skip to content

Commit ea18bf6

Browse files
Automatic removal of unused f-strings (#516)
* add F541 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent b8ae6d6 commit ea18bf6

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ extend-exclude = '''
9292
exclude = ["docs/*"]
9393

9494
[tool.ruff.lint]
95-
select = ["F401", "I"] # TODO: eventually, expand to other 'D', and other 'F' linting
95+
select = ["F401", "F541", "I"] # TODO: eventually, expand to other 'D', and other 'F' linting
9696
fixable = ["ALL"]
9797

9898
[tool.ruff.lint.per-file-ignores]

tests/streaming_cli_tests.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test_dandiset_streaming_cli(tmpdir: py.path.local):
2929
expected_console_output = io.readlines()
3030

3131
# Different platforms maybe have different indices for start and end of test reports
32-
report_start = test_console_output.index(f"0 CRITICAL\n")
32+
report_start = test_console_output.index("0 CRITICAL\n")
3333
expected_report_length = 38
3434
report_end = report_start + expected_report_length
3535
assert test_console_output[report_start:report_end] == expected_console_output[14:]
@@ -52,7 +52,7 @@ def test_dandiset_streaming_cli_with_version(tmpdir: py.path.local):
5252
expected_console_output = io.readlines()
5353

5454
# Different platforms maybe have different indices for start and end of test reports
55-
report_start = test_console_output.index(f"0 CRITICAL\n")
55+
report_start = test_console_output.index("0 CRITICAL\n")
5656
expected_report_length = 38
5757
report_end = report_start + expected_report_length
5858
assert test_console_output[report_start:report_end] == expected_console_output[14:]
@@ -82,7 +82,7 @@ def test_dandiset_streaming_cli_saved_report(tmpdir: py.path.local):
8282
expected_report = io.readlines()
8383

8484
# Different platforms maybe have different indices for start and end of test reports
85-
report_start = test_report.index(f"0 CRITICAL\n")
85+
report_start = test_report.index("0 CRITICAL\n")
8686
expected_report_length = 38
8787
report_end = report_start + expected_report_length
8888
assert test_report[report_start:report_end] == expected_report[14:]
@@ -115,7 +115,7 @@ def test_dandiset_streaming_cli_with_version_saved_report(tmpdir: py.path.local)
115115
expected_report = io.readlines()
116116

117117
# Different platforms maybe have different indices for start and end of test reports
118-
report_start = test_report.index(f"0 CRITICAL\n")
118+
report_start = test_report.index("0 CRITICAL\n")
119119
expected_report_length = 38
120120
report_end = report_start + expected_report_length
121121
assert test_report[report_start:report_end] == expected_report[14:]

tests/test_inspector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def setUpClass(cls):
150150
add_non_matching_timestamps_dimension(nwbfiles[3])
151151

152152
cls.nwbfile_paths = [str(cls.tempdir / f"testing{j}.nwb") for j in range(num_nwbfiles)]
153-
cls.nwbfile_paths[3] = str(cls.tempdir / f"._testing3.nwb")
153+
cls.nwbfile_paths[3] = str(cls.tempdir / "._testing3.nwb")
154154
for nwbfile_path, nwbfile in zip(cls.nwbfile_paths, nwbfiles):
155155
with NWBHDF5IO(path=nwbfile_path, mode="w") as io:
156156
io.write(nwbfile)

tests/unit_tests/test_behavior.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ def test_trigger_check_compass_direction_unit():
6464
)
6565

6666
assert (
67-
check_compass_direction_unit(obj)[0].message == f"SpatialSeries objects inside a CompassDirection object "
68-
f"should be angular and should have a unit of 'degrees' or 'radians', but 'SpatialSeries' has units 'meters'."
67+
check_compass_direction_unit(obj)[0].message == "SpatialSeries objects inside a CompassDirection object "
68+
"should be angular and should have a unit of 'degrees' or 'radians', but 'SpatialSeries' has units 'meters'."
6969
)
7070

7171

tests/unit_tests/test_image_series.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
@unittest.skipIf(
2424
TESTING_FILES_FOLDER_PATH is None,
2525
reason=(
26-
f"These ImageSeries unit tests were skipped because the environment variable "
26+
"These ImageSeries unit tests were skipped because the environment variable "
2727
"'TESTING_FILES_FOLDER_PATH' was not set!"
2828
),
2929
)

tests/unit_tests/test_images.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def test_check_order_of_images_len():
4040
images = Images(name="my_images", images=imgs, order_of_images=img_refs)
4141

4242
assert check_order_of_images_len(images) == InspectorMessage(
43-
message=f"Length of order_of_images (6) does not match the number of images (5).",
43+
message="Length of order_of_images (6) does not match the number of images (5).",
4444
importance=Importance.BEST_PRACTICE_VIOLATION,
4545
check_function_name="check_order_of_images_len",
4646
object_type="Images",

tests/unit_tests/test_tables.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ def test_table_time_columns_are_not_negative_fail():
442442

443443
assert check_table_time_columns_are_not_negative(test_table) == [
444444
InspectorMessage(
445-
message=f"Timestamps in column test_time should not be negative."
445+
message="Timestamps in column test_time should not be negative."
446446
" It is recommended to align the `session_start_time` or `timestamps_reference_time` to be the earliest time value that occurs in the data, and shift all other signals accordingly.",
447447
importance=Importance.BEST_PRACTICE_SUGGESTION,
448448
check_function_name="check_table_time_columns_are_not_negative",
@@ -451,7 +451,7 @@ def test_table_time_columns_are_not_negative_fail():
451451
location="/",
452452
),
453453
InspectorMessage(
454-
message=f"Timestamps in column start_time should not be negative."
454+
message="Timestamps in column start_time should not be negative."
455455
" It is recommended to align the `session_start_time` or `timestamps_reference_time` to be the earliest time value that occurs in the data, and shift all other signals accordingly.",
456456
importance=Importance.BEST_PRACTICE_SUGGESTION,
457457
check_function_name="check_table_time_columns_are_not_negative",

0 commit comments

Comments
 (0)