From 4017a773c7ac3659892b00bc20bf8b7821c87a64 Mon Sep 17 00:00:00 2001 From: Israel Fruchter Date: Tue, 17 Dec 2024 10:53:57 +0200 Subject: [PATCH] feature(ruff): add `f-string-missing-placeholders (F541)` to linter since we have this check on older branches using pylint and it's easily fixable checked, we are introducing this one to minimize issues with backporting Ref: https://docs.astral.sh/ruff/rules/f-string-missing-placeholders/#f-string-missing-placeholders-f541 --- mgmt_cli_test.py | 2 +- pyproject.toml | 1 + sdcm/argus_results.py | 2 +- sdcm/sct_config.py | 2 +- sdcm/tester.py | 2 +- unit_tests/rest/test_compaction_manager_client.py | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mgmt_cli_test.py b/mgmt_cli_test.py index 6bcccf9b61..726bddfad2 100644 --- a/mgmt_cli_test.py +++ b/mgmt_cli_test.py @@ -1611,7 +1611,7 @@ def test_restore_from_precreated_backup(self, snapshot_name: str, restore_outsid keyspace_name=snapshot_data.keyspaces[0], num_of_rows=snapshot_data.number_of_rows) else: - self.log.info(f"Skipping verification read stress because of the test or snapshot configuration") + self.log.info("Skipping verification read stress because of the test or snapshot configuration") def test_restore_benchmark(self): """Benchmark restore operation. diff --git a/pyproject.toml b/pyproject.toml index 6c1b5af04a..0518facd18 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,6 +4,7 @@ lint.select = [ "F401", "F821", "F823", "F841", "PL", "PLR0913","PLR0914", "PLR0916", "YTT", + "F541", ] lint.ignore = ["E501", "PLR2004"] diff --git a/sdcm/argus_results.py b/sdcm/argus_results.py index cf8d34281f..b265c5b686 100644 --- a/sdcm/argus_results.py +++ b/sdcm/argus_results.py @@ -204,7 +204,7 @@ def send_result_to_argus(argus_client: ArgusClient, workload: str, name: str, de result_table = ReactorStallStatsResult() result_table.name = f"{workload} - {name} - stalls - {event_name}" result_table.description = f"{event_name} event counts" - result_table.add_result(column=f"total", row=f"Cycle #{cycle}", + result_table.add_result(column="total", row=f"Cycle #{cycle}", value=stall_stats["counter"], status=Status.PASS) for interval, value in stall_stats["ms"].items(): result_table.add_result(column=f"{interval}ms", row=f"Cycle #{cycle}", diff --git a/sdcm/sct_config.py b/sdcm/sct_config.py index 3d87aa65c6..3e43ca13d6 100644 --- a/sdcm/sct_config.py +++ b/sdcm/sct_config.py @@ -2823,7 +2823,7 @@ def _verify_scylla_bench_mode_and_workload_parameters(self): def _validate_docker_backend_parameters(self): if self.get("use_mgmt"): - raise ValueError(f"Scylla Manager is not supported for docker backend") + raise ValueError("Scylla Manager is not supported for docker backend") def init_and_verify_sct_config() -> SCTConfiguration: diff --git a/sdcm/tester.py b/sdcm/tester.py index 61bd2eb400..9575712f0d 100644 --- a/sdcm/tester.py +++ b/sdcm/tester.py @@ -2961,7 +2961,7 @@ def clean_resources(self): self.destroy_credentials() - @silence(name=f"Save node schema", raise_error_event=False) + @silence(name="Save node schema", raise_error_event=False) def save_cqlsh_output_in_file(self, node, cmd: str, log_file: str): self.log.info("Save command '%s' output in the file. Node %s", cmd, node.name) diff --git a/unit_tests/rest/test_compaction_manager_client.py b/unit_tests/rest/test_compaction_manager_client.py index 47019ecc64..9ceb87cfed 100644 --- a/unit_tests/rest/test_compaction_manager_client.py +++ b/unit_tests/rest/test_compaction_manager_client.py @@ -39,4 +39,4 @@ def test_compaction_manager_stop_compaction(): client = CompactionManagerClient(FakeNode()) result = partial(client.stop_compaction, compaction_type="reshape")() - assert result.stdout == f'curl -v -X POST "http://localhost:10000/compaction_manager/stop_compaction?type=RESHAPE"' + assert result.stdout == 'curl -v -X POST "http://localhost:10000/compaction_manager/stop_compaction?type=RESHAPE"'