Skip to content

Conversation

@richm
Copy link
Contributor

@richm richm commented May 7, 2025

Summary by Sourcery

Configure Sourcery AI code review action with a custom configuration file

CI:

  • Added Sourcery configuration file to customize code review settings

Chores:

  • Updated GitHub workflow to use a specific Sourcery configuration

@sourcery-ai
Copy link

sourcery-ai bot commented May 7, 2025

Reviewer's Guide

This pull request introduces a Sourcery configuration file (.github/config/sourcery.yaml) and updates the sourcery.yml GitHub workflow to use this new configuration, allowing for customized code quality checks and refactoring suggestions.

File-Level Changes

Change Details Files
Added a Sourcery configuration file to customize linting, refactoring, and reporting behavior.
  • Specified directories and files to be ignored by Sourcery (e.g., .git, venv).
  • Configured rule settings: enabled default rules, disabled specific rules (like dict-literal, list-literal), and set the Python version to 3.6.
  • Defined a quality threshold metric.
  • Set up GitHub integration options, including label management and review requests.
  • Configured clone detection parameters.
.github/config/sourcery.yaml
Updated the Sourcery GitHub workflow to utilize the newly added configuration file.
  • Modified the Sourcery action to include the config parameter, pointing to .github/config/sourcery.yaml.
.github/workflows/sourcery.yml

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

@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 @richm - I've reviewed your changes - here's some feedback:

  • Verify the python_version in sourcery.yaml (currently '3.6') aligns with the project's actual minimum Python target.
  • Review the list of disabled Sourcery rules in sourcery.yaml (e.g., for f-strings, dict/list literals) to ensure it reflects the intended style choices for this project.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Review instructions: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Documentation: all looks good

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.

- refactoring
- suggestion
- comment
python_version: "3.6"
Copy link

Choose a reason for hiding this comment

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

suggestion: Consider updating the python_version as 3.6 is approaching end-of-life.

Upgrading to a newer Python version ensures better compatibility, performance, and alignment with current standards.

Suggested change
python_version: "3.6"
python_version: "3.9"

@codecov
Copy link

codecov bot commented May 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 10.72%. Comparing base (59fd1c6) to head (d85244e).
Report is 53 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (59fd1c6) and HEAD (d85244e). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (59fd1c6) HEAD (d85244e)
sanity 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #528      +/-   ##
==========================================
- Coverage   16.54%   10.72%   -5.83%     
==========================================
  Files           2        8       +6     
  Lines         284     1949    +1665     
  Branches       79        0      -79     
==========================================
+ Hits           47      209     +162     
- Misses        237     1740    +1503     
Flag Coverage Δ
sanity ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@richm richm merged commit d53ec1a into linux-system-roles:main May 7, 2025
26 of 30 checks passed
@richm richm deleted the try-sourcery branch May 7, 2025 22:32
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