Skip to content

Fix Github report format#132

Merged
Kilo59 merged 2 commits intomainfrom
fix-github-format
Mar 29, 2026
Merged

Fix Github report format#132
Kilo59 merged 2 commits intomainfrom
fix-github-format

Conversation

@Kilo59
Copy link
Copy Markdown
Owner

@Kilo59 Kilo59 commented Mar 29, 2026

Summary by Sourcery

Adjust GitHub formatter output to include a default line number and bump the project version.

Bug Fixes:

  • Ensure GitHub error and warning annotations include a line number when a file path is provided.

Build:

  • Bump project version from 0.1.3.dev2 to 0.1.3.dev3.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Mar 29, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts GitHub annotation formatting to always include a default line number for error/warning messages and bumps the package version for release.

Sequence diagram for GitHub annotations with default line number

sequenceDiagram
    actor Developer
    participant RuffSyncFormatter as RuffSyncFormatter
    participant GitHubActions as GitHub_Actions_Interpreter

    Developer->>RuffSyncFormatter: error(message, file_path)
    RuffSyncFormatter->>RuffSyncFormatter: escape(file_path, is_property=True)
    RuffSyncFormatter->>RuffSyncFormatter: build file_arg = file=<path>,line=1,
    RuffSyncFormatter->>RuffSyncFormatter: escape("Ruff Sync Error", is_property=True)
    RuffSyncFormatter->>GitHubActions: write ::error file=<path>,line=1, title=Ruff Sync Error::message
    GitHubActions->>GitHubActions: parse annotation
    GitHubActions-->>Developer: display error pinned to line 1 in file

    Developer->>RuffSyncFormatter: warning(message, file_path)
    RuffSyncFormatter->>RuffSyncFormatter: escape(file_path, is_property=True)
    RuffSyncFormatter->>RuffSyncFormatter: build file_arg = file=<path>,line=1,
    RuffSyncFormatter->>RuffSyncFormatter: escape("Ruff Sync Warning", is_property=True)
    RuffSyncFormatter->>GitHubActions: write ::warning file=<path>,line=1, title=Ruff Sync Warning::message
    GitHubActions->>GitHubActions: parse annotation
    GitHubActions-->>Developer: display warning pinned to line 1 in file
Loading

File-Level Changes

Change Details Files
Ensure GitHub-style error and warning annotations always include a line number for proper rendering.
  • Update error annotation construction to append a default line=1 parameter when a file path is present.
  • Update warning annotation construction to append a default line=1 parameter when a file path is present.
  • Preserve existing escaping and logging behavior while extending the annotation argument string.
src/ruff_sync/formatters.py
Bump project/package version for the new bugfix release.
  • Increment project version from 0.1.3.dev2 to 0.1.3.dev3 in pyproject configuration.
  • Update lockfile to reflect the new version and dependency state.
pyproject.toml
uv.lock

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

@github-actions
Copy link
Copy Markdown

Wily: No changes in complexity detected.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.78%. Comparing base (e3413c5) to head (49c2d5a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #132   +/-   ##
=======================================
  Coverage   92.78%   92.78%           
=======================================
  Files           6        6           
  Lines         929      929           
=======================================
  Hits          862      862           
  Misses         67       67           

☔ 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.

@Kilo59 Kilo59 added the bug Something isn't working label Mar 29, 2026
@Kilo59 Kilo59 self-assigned this Mar 29, 2026
@Kilo59 Kilo59 marked this pull request as ready for review March 29, 2026 21:47
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 left some high level feedback:

  • Instead of hardcoding line=1, consider threading through an optional line argument (defaulting to 1) so callers can specify more precise locations in the future.
  • The logic for building the GitHub annotation arguments in error and warning is now duplicated; you could extract a small helper to generate file_arg (and potentially other shared pieces) to keep these paths consistent.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Instead of hardcoding `line=1`, consider threading through an optional `line` argument (defaulting to 1) so callers can specify more precise locations in the future.
- The logic for building the GitHub annotation arguments in `error` and `warning` is now duplicated; you could extract a small helper to generate `file_arg` (and potentially other shared pieces) to keep these paths consistent.

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.

@Kilo59 Kilo59 merged commit a98c888 into main Mar 29, 2026
16 checks passed
@Kilo59 Kilo59 deleted the fix-github-format branch March 29, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant