Skip to content

refactor: fix python black formatting#318

Merged
richm merged 1 commit intolinux-system-roles:mainfrom
richm:fix-python-black
Mar 12, 2026
Merged

refactor: fix python black formatting#318
richm merged 1 commit intolinux-system-roles:mainfrom
richm:fix-python-black

Conversation

@richm
Copy link
Copy Markdown
Collaborator

@richm richm commented Mar 12, 2026

ensure python formatting conforms to the latest python black

Signed-off-by: Rich Megginson rmeggins@redhat.com

Summary by Sourcery

Align Python certificate provider modules with current Black code formatting conventions.

Enhancements:

  • Normalize tuple unpacking style in certificate provider helpers to match Black formatting.
  • Inline multi-line string formatting for systemd unit file writing to comply with updated style guidelines.
  • Remove superfluous blank lines in provider and library modules for consistent formatting.

ensure python formatting conforms to the latest python black

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
@richm richm requested review from rjeffman and spetrosi as code owners March 12, 2026 22:52
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Mar 12, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Refactors Python modules to conform to the latest Black formatting rules, primarily simplifying tuple unpacking, tightening multiline string formatting, and removing unnecessary blank lines.

File-Level Changes

Change Details Files
Simplified tuple unpacking assignments to match Black formatting.
  • Changed parenthesized tuple unpacking to direct multiple assignment in certmonger provider.
  • Updated base provider to use direct multiple assignment for permission retrieval.
module_utils/certificate_lsr/providers/certmonger.py
module_utils/certificate_lsr/providers/base.py
Reformatted multiline string write call to comply with Black’s preferred layout.
  • Collapsed nested f.write call and format call into a single line with the triple-quoted string literal followed by .format().
module_utils/certificate_lsr/providers/certmonger.py
Removed superfluous blank lines around imports and constants.
  • Deleted extra blank line between imports and KEY_USAGE_CHOICES definition.
  • Deleted extra blank line between imports and PROVIDERS definition.
library/certificate_request.py
module_utils/certificate_lsr/providers/providers.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@richm richm merged commit eba3c0d into linux-system-roles:main Mar 12, 2026
25 of 30 checks passed
@richm richm deleted the fix-python-black branch March 12, 2026 23:14
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.

1 participant