Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pylint] pylint and flake8 updates #3597

Merged
merged 1 commit into from
May 3, 2024

Conversation

arif-ali
Copy link
Member

@arif-ali arif-ali commented Apr 15, 2024

pylint for the following rules applied

  • C0411: wrong-import-order
  • R0912: too-many-branches
  • R0914: too-many-locals
  • R1725: super-with-arguments
  • E1101: no-member

Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines

  • Is the commit message split over multiple lines and hard-wrapped at 72 characters?
  • Is the subject and message clear and concise?
  • Does the subject start with [plugin_name] if submitting a plugin patch or a [section_name] if part of the core sosreport code?
  • Does the commit contain a Signed-off-by: First Lastname email@example.com?
  • Are any related Issues or existing PRs properly referenced via a Closes (Issue) or Resolved (PR) line?
  • Are all passwords or private data gathered by this PR obfuscated?

Copy link

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/sosreport-sos-3597
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

arif-ali added a commit to arif-ali/sos that referenced this pull request Apr 16, 2024
pylint for the following rules applied

* C0411: wrong-import-order
* R0912: too-many-branches
* R0914: too-many-locals
* R1725: super-with-arguments
* E1101: no-member

Resolves: sosreport#3597

Signed-off-by: Arif Ali <arif.ali@canonical.com>
arif-ali added a commit to arif-ali/sos that referenced this pull request Apr 21, 2024
pylint for the following rules applied

* C0411: wrong-import-order
* R0912: too-many-branches
* R0914: too-many-locals
* R1725: super-with-arguments
* E1101: no-member

Resolves: sosreport#3597

Signed-off-by: Arif Ali <arif.ali@canonical.com>
pylint for the following rules applied

* C0411: wrong-import-order
* R0912: too-many-branches
* R0914: too-many-locals
* R1725: super-with-arguments
* E1101: no-member

Resolves: sosreport#3597

Signed-off-by: Arif Ali <arif.ali@canonical.com>
return False
self.log_info(f'Retrieving sos report from {self.address}')
self.ui_msg('Retrieving sos report...')
if self.need_sudo or self.opts.become_root:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason why this was refactored was, where retrieve_sosreport() function is being used it already checks for self.sos_path, so the code under the else seemed redundant

@arif-ali
Copy link
Member Author

pylint now looks great with the 2 PRs for f-strings done. Based on the output of pylint here, #3604 should resolve the rest.

This way, we can then enable it, so that future PRs we'll get errors for f-strings too.

Copy link
Member

@TurboTurtle TurboTurtle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -322,7 +323,7 @@ def _send_pexpect_password(self, index, result):
:type result: ``pexpect.spawn``
"""
if index == 2:
if not self.opts.sudo_pw and not self.opt.nopasswd_sudo:
if not self.opts.sudo_pw and not self.opts.nopasswd_sudo:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't catch it, pylint did

self.all_pkgs_by_name_regex("fedora-release-.*")[-1]
self.package_manager.all_pkgs_by_name_regex(
"fedora-release-.*")[-1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How this could even work now..? good catch.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't catch it, pylint did

@TurboTurtle TurboTurtle merged commit 5eef057 into sosreport:main May 3, 2024
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants