diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 03e0840f0d..cbb8ac288d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ minimum_pre_commit_version: "2.9.0" repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.7.3 + rev: v0.14.7 hooks: # Run the linter. - id: ruff @@ -11,7 +11,7 @@ repos: - id: ruff-format - repo: "https://github.com/pre-commit/pre-commit-hooks" - rev: "v5.0.0" + rev: "v6.0.0" hooks: - id: "end-of-file-fixer" - id: "trailing-whitespace" @@ -23,25 +23,25 @@ repos: hooks: - id: "check-json5" - repo: "https://github.com/teemtee/tmt.git" - rev: "1.38.0" + rev: "1.62.1" hooks: - id: "tmt-tests-lint" verbose: false files: ^(tests/|plans/) - repo: https://github.com/packit/pre-commit-hooks - rev: v1.2.0 + rev: v1.3.0 hooks: - id: check-rebase args: - https://github.com/oamg/convert2rhel.git stages: [manual, pre-push] - repo: https://github.com/gitleaks/gitleaks - rev: v8.21.2 + rev: v8.30.0 hooks: - id: gitleaks stages: [manual, pre-push] - repo: https://github.com/jendrikseipp/vulture - rev: v2.13 + rev: v2.14 hooks: - id: vulture diff --git a/convert2rhel/actions/conversion/set_efi_config.py b/convert2rhel/actions/conversion/set_efi_config.py index 280644be53..31d24db311 100644 --- a/convert2rhel/actions/conversion/set_efi_config.py +++ b/convert2rhel/actions/conversion/set_efi_config.py @@ -252,8 +252,7 @@ def run(self): if not grub.is_efi(): logger.info( - "Unable to collect data about UEFI on a BIOS system, did not perform UEFI bootloader " - "entry replacement." + "Unable to collect data about UEFI on a BIOS system, did not perform UEFI bootloader entry replacement." ) return diff --git a/convert2rhel/actions/post_conversion/hostmetering.py b/convert2rhel/actions/post_conversion/hostmetering.py index 5fad03c582..0959ec5b35 100644 --- a/convert2rhel/actions/post_conversion/hostmetering.py +++ b/convert2rhel/actions/post_conversion/hostmetering.py @@ -90,8 +90,7 @@ def run(self): level="WARNING", id="CONFIGURE_HOST_METERING_FAILURE", title="Failed to enable and start host metering service.", - description="The host metering service failed to start" - " successfully and won't be able to keep track.", + description="The host metering service failed to start successfully and won't be able to keep track.", diagnosis="Command {command} failed with {error_message}".format( command=command, error_message=error_message ), diff --git a/convert2rhel/actions/post_conversion/modified_rpm_files_diff.py b/convert2rhel/actions/post_conversion/modified_rpm_files_diff.py index a458817f57..2b4b114479 100644 --- a/convert2rhel/actions/post_conversion/modified_rpm_files_diff.py +++ b/convert2rhel/actions/post_conversion/modified_rpm_files_diff.py @@ -77,7 +77,7 @@ def run(self): level="INFO", id="FOUND_MODIFIED_RPM_FILES", title="Modified rpm files from before and after the conversion were found.", - description="Comparison of modified rpm files from before and after " "the conversion: \n{}".format( + description="Comparison of modified rpm files from before and after the conversion: \n{}".format( modified_rpm_files_diff ), ) diff --git a/convert2rhel/actions/pre_ponr_changes/handle_packages.py b/convert2rhel/actions/pre_ponr_changes/handle_packages.py index db4acc02b3..d84220c193 100644 --- a/convert2rhel/actions/pre_ponr_changes/handle_packages.py +++ b/convert2rhel/actions/pre_ponr_changes/handle_packages.py @@ -167,7 +167,7 @@ def run(self): " conversion. This list includes packages that are known to cause a conversion failure." ), remediations=( - "Remove the packages manually before running convert2rhel again:\n" "yum remove -y {}".format( + "Remove the packages manually before running convert2rhel again:\nyum remove -y {}".format( " ".join(pkgs_not_removed) ) ), diff --git a/convert2rhel/cli.py b/convert2rhel/cli.py index 3ae5251b86..8b98bee642 100644 --- a/convert2rhel/cli.py +++ b/convert2rhel/cli.py @@ -145,8 +145,7 @@ def _register_options(self): self._shared_options_parser.add_argument( "--els", action="store_true", - help="Explicitly recognize the system as els, utilizing els repos." - " This option is meant for el7 systems.", + help="Explicitly recognize the system as els, utilizing els repos. This option is meant for el7 systems.", ) self._shared_options_parser.add_argument( "--enablerepo", diff --git a/convert2rhel/repo.py b/convert2rhel/repo.py index ddfa5690c7..3109269dac 100644 --- a/convert2rhel/repo.py +++ b/convert2rhel/repo.py @@ -239,5 +239,5 @@ def write_temporary_repofile(contents): raise exceptions.CriticalError( id_="STORE_REPOFILE_FAILED", title="Failed to store a repository file", - description="Failed to write a repository file contents to {}.\n" "Reason: {}".format(f.name, str(err)), + description="Failed to write a repository file contents to {}.\nReason: {}".format(f.name, str(err)), ) diff --git a/convert2rhel/unit_tests/actions/post_conversion/update_grub_test.py b/convert2rhel/unit_tests/actions/post_conversion/update_grub_test.py index 4d94eaedfe..42f7c2b4dc 100644 --- a/convert2rhel/unit_tests/actions/post_conversion/update_grub_test.py +++ b/convert2rhel/unit_tests/actions/post_conversion/update_grub_test.py @@ -244,6 +244,6 @@ def test_update_grub_error(update_grub_instance, monkeypatch, get_partition_erro level="ERROR", id="FAILED_TO_IDENTIFY_GRUB2_BLOCK_DEVICE", title="Failed to identify GRUB2 block device", - description="The block device could not be identified, please look at the diagnosis " "for more information.", + description="The block device could not be identified, please look at the diagnosis for more information.", diagnosis=diagnosis, ) diff --git a/convert2rhel/unit_tests/actions/pre_ponr_changes/kernel_modules_test.py b/convert2rhel/unit_tests/actions/pre_ponr_changes/kernel_modules_test.py index 9e3ee44e7b..ce20369942 100644 --- a/convert2rhel/unit_tests/actions/pre_ponr_changes/kernel_modules_test.py +++ b/convert2rhel/unit_tests/actions/pre_ponr_changes/kernel_modules_test.py @@ -162,7 +162,7 @@ def test_ensure_compatibility_of_kmods( ), ( HOST_MODULES_STUB_BAD, - "kernel-core-0:4.18.0-240.10.1.el8_3.x86_64\n" "kernel-core-0:4.19.0-240.10.1.el8_3.i486\n", + "kernel-core-0:4.18.0-240.10.1.el8_3.x86_64\nkernel-core-0:4.19.0-240.10.1.el8_3.i486\n", ("", 0), "CANNOT_COMPARE_PACKAGE_VERSIONS", "ERROR", diff --git a/convert2rhel/unit_tests/cli_test.py b/convert2rhel/unit_tests/cli_test.py index 8f15676cad..ea37ac91f4 100644 --- a/convert2rhel/unit_tests/cli_test.py +++ b/convert2rhel/unit_tests/cli_test.py @@ -143,8 +143,7 @@ def test_serverurl_with_no_rhsm_credentials(self, caplog, monkeypatch): cli.CLI() message = ( - "Ignoring the --serverurl option. It has no effect when no credentials to" - " subscribe the system were given." + "Ignoring the --serverurl option. It has no effect when no credentials to subscribe the system were given." ) assert message in caplog.text diff --git a/convert2rhel/unit_tests/subscription_test.py b/convert2rhel/unit_tests/subscription_test.py index 56bbaa6225..ebe352c5f2 100644 --- a/convert2rhel/unit_tests/subscription_test.py +++ b/convert2rhel/unit_tests/subscription_test.py @@ -802,9 +802,7 @@ def test_registration_succeeds_but_dbus_returns_noreply(self, monkeypatch, mocke utils, "run_subprocess", RunSubprocessMocked( - return_string=( - "system identity: 1234-56-78-9abc\n" "name: abc-123\n" "org name: Test\n" "org ID: 12345678910\n" - ) + return_string=("system identity: 1234-56-78-9abc\nname: abc-123\norg name: Test\norg ID: 12345678910\n") ), ) diff --git a/tests/integration/test_helpers/satellite.py b/tests/integration/test_helpers/satellite.py index c1c0160d98..9f8c6e4269 100644 --- a/tests/integration/test_helpers/satellite.py +++ b/tests/integration/test_helpers/satellite.py @@ -30,9 +30,9 @@ def get_satellite_curl_command(self): return self._sat_reg_commands.get(self.key) def _curl_the_satellite_script(self, curl_command): - assert ( - self.shell(f"{curl_command} -o {self._sat_script_location}", silent=True).returncode == 0 - ), "Failed to curl the satellite script to the machine." + assert self.shell(f"{curl_command} -o {self._sat_script_location}", silent=True).returncode == 0, ( + "Failed to curl the satellite script to the machine." + ) # [danmyway] This is just a mitigation of rhn-client-tools pkg obsoleting subscription-manager during upgrade # TODO remove when https://github.com/theforeman/foreman/pull/10280 gets merged and or foreman 3.12 is out