oamg / convert2rhel

A tool to automate converting Oracle/CentOS/Scientific/Rocky/Alma Linux and CentOS Stream to Red Hat Enterprise Linux
GNU General Public License v3.0
104 stars 84 forks source link

chore: replace pylint and black with ruff #1382

Closed Venefilyn closed 2 months ago

Venefilyn commented 2 months ago

Ruff is a drop-in replacement for black and also handles linting for us in a lot nicer way than pylint. More specifically it is a lot faster than the alternatives and allows us to enforce PyFormat for strings rather than percent-format or f-strings.

Jira Issues:

-

Checklist

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 95.86466% with 11 lines in your changes missing coverage. Please review.

Project coverage is 96.51%. Comparing base (27e14a4) to head (3a43a0b). Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
...ions/system_checks/check_firewalld_availability.py 50.00% 2 Missing :warning:
convert2rhel/toolopts/config.py 75.00% 2 Missing :warning:
convert2rhel/applock.py 75.00% 1 Missing :warning:
convert2rhel/exceptions.py 0.00% 1 Missing :warning:
convert2rhel/grub.py 94.44% 1 Missing :warning:
convert2rhel/pkghandler.py 96.55% 1 Missing :warning:
convert2rhel/redhatrelease.py 80.00% 1 Missing :warning:
convert2rhel/subscription.py 94.11% 1 Missing :warning:
convert2rhel/utils/__init__.py 96.42% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1382 +/- ## ======================================= Coverage 96.51% 96.51% ======================================= Files 71 71 Lines 5077 5077 Branches 883 883 ======================================= Hits 4900 4900 Misses 98 98 Partials 79 79 ``` | [Flag](https://app.codecov.io/gh/oamg/convert2rhel/pull/1382/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=oamg) | Coverage Δ | | |---|---|---| | [centos-linux-7](https://app.codecov.io/gh/oamg/convert2rhel/pull/1382/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=oamg) | `92.01% <89.47%> (ø)` | | | [centos-linux-8](https://app.codecov.io/gh/oamg/convert2rhel/pull/1382/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=oamg) | `92.88% <87.59%> (ø)` | | | [centos-linux-9](https://app.codecov.io/gh/oamg/convert2rhel/pull/1382/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=oamg) | `92.92% <87.59%> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=oamg#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Venefilyn commented 2 months ago

/packit test --labels sanity

has-bot commented 2 months ago

This PR does not require integration tests to be run.


Comment generated by an automation.

Log | Bot Usage
has-bot commented 2 months ago

/packit test --labels sanity


Comment generated by an automation.

Log | Bot Usage
r0x0d commented 2 months ago

I've added the sanity test label just to be sure that nothing is broken. It will not, but just in case. Doesn't hurt to run the sanity tests suite

kokesak commented 2 months ago

/packit test --labels sanity

Venefilyn commented 2 months ago

/packit test --labels sanity

Venefilyn commented 2 months ago

/packit test --labels sanity

Venefilyn commented 2 months ago

/packit test --labels sanity

Venefilyn commented 2 months ago

/packit test --labels sanity

Venefilyn commented 2 months ago

@kokesak All integration tests are passing now with the change I made

# We use pytest_plugins to allow us to use fixtures we define in other files without the need to explicitly import them
# inside each test file.
# LINK - https://docs.pytest.org/en/7.0.x/reference/reference.html#globalvar-pytest_plugins
pytest_plugins = (
    "test_helpers.common_functions",
    "test_helpers.workarounds",
)

As for unit tests failing, it is unclear to me at the moment what the underlying issue is with the encoding tests in el7

But for the failing test relating to restorable file it is unrelated to any change I've made. It is just a unit test previously not being executed due to wrong name. Unsure if the error is the test or implementation atm

@r0x0d you are a code owner as well atm, wanna give a quick review of the devcontainer stuff that's changed?

Venefilyn commented 2 months ago

/packit test --labels sanity

Venefilyn commented 2 months ago

/packit test --labels sanity