Skip to content

Docs: Better usage section#109

Merged
Kilo59 merged 5 commits intomainfrom
docs/better-usage
Mar 16, 2026
Merged

Docs: Better usage section#109
Kilo59 merged 5 commits intomainfrom
docs/better-usage

Conversation

@Kilo59
Copy link
Copy Markdown
Owner

@Kilo59 Kilo59 commented Mar 16, 2026

Summary by Sourcery

Improve and expand documentation for ruff-sync usage, workflows, and configuration, and update the site favicon.

Build:

  • Change MkDocs configuration to use a dedicated favicon asset instead of the logo image.

Documentation:

  • Rewrite the usage guide to focus on common workflows, configuration patterns, and clear command reference for pull and check.
  • Update the README usage section to highlight typical pull/check scenarios and link to the full usage docs.
  • Clarify configuration merging behavior, especially multi-upstream "last one wins" logic, and how exclusions are treated in CI.
  • Expand CI integration docs to explain how excluded settings interact with ruff-sync check.
  • Refine the index page key-features and quick-start sections to emphasize bootstrapping, efficient Git usage, and CI readiness.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Mar 16, 2026

Reviewer's Guide

This PR overhauls the Ruff Sync documentation to be workflow-focused, clarifies configuration/merge behavior, improves CI guidance, and aligns README and site navigation with the updated usage model, including favicon change.

Flow diagram for ruff-sync check behavior in CI with semantic and exclude options

graph TD
  A_start["Start CI job"] --> B_load_pyproject["Load local pyproject.toml"]
  B_load_pyproject --> C_read_config["Read tool.ruff_sync settings (upstream, exclude)"]
  C_read_config --> D_resolve_upstream["Resolve one_or_more upstream URLs"]
  D_resolve_upstream --> E_fetch_configs["Fetch upstream configuration sources in order"]
  E_fetch_configs --> F_merge_upstream["Merge upstream configs (last_source_wins, deep_merge_tables)"]
  F_merge_upstream --> G_apply_exclude["Apply exclude list to prevent overriding local keys"]
  G_apply_exclude --> H_select_mode{Semantic_mode_enabled}

  H_select_mode -->|Yes| I_semantic_compare["Compare functional config only (ignore comments, whitespace, key_order)"]
  H_select_mode -->|No| J_exact_compare["Compare full config including formatting and ordering"]

  I_semantic_compare --> K_result{Configs_equivalent}
  J_exact_compare --> K_result

  K_result -->|Yes| L_exit_zero["Exit 0 (CI passes; no drift)"]
  K_result -->|No| M_show_diff["Show unified diff (if diff_enabled)"]
  M_show_diff --> N_exit_one["Exit 1 (CI fails; configuration drift)"]
Loading

File-Level Changes

Change Details Files
Restructure usage docs around common workflows and expand explanations of pull/check behavior and merge semantics.
  • Introduce a workflow-oriented introduction that explains goals and daily usage patterns.
  • Add detailed examples for basic sync, persistent configuration via [tool.ruff-sync], project initialization with --init, subdirectory syncing via --path, and excluding specific rules.
  • Clarify behavior of the check command, including semantic comparisons and CI recommendations.
  • Enhance explanation of lossless TOML merging, explicitly noting preservation of comments, whitespace, key order, and non-Ruff sections.
  • Reorganize and expand the command reference for pull and check with clearer flag semantics and multi-URL behavior.
  • Tighten wording in the logic flow section to emphasize internal behavior rather than user-facing steps.
docs/usage.md
Align README usage section with new CLI patterns and link out to full usage docs.
  • Replace generic ruff-sync invocation examples with explicit pull/check subcommands and categorized snippets (basic sync, persistent config, init, subdirectories, git usage, exclusions, CI).
  • Clarify how semantic check works and recommend it for CI.
  • Replace the generic help-text pointer with a link to the hosted Usage documentation for advanced details.
README.md
Refine landing page features and quick-start docs to emphasize init flow, efficient git behavior, and CI/semantic comparison.
  • Update key feature bullets to highlight formatting preservation via tomlkit, deep merge behavior, efficient git handling, zero-config bootstrapping with --init, and semantic comparison for CI.
  • Restructure the quick start to first show initializing a project with --init, then configuring/updating an existing project via [tool.ruff-sync] and uv run ruff-sync pull.
  • Improve phrasing around upstream URL configuration to clarify its role as the default source.
docs/index.md
Clarify configuration merging semantics for multiple upstreams.
  • Clarify that multiple upstream sources are merged sequentially from top to bottom with later ones overriding earlier ones.
  • Add an explicit "Last One Wins" tip describing simple-key override behavior vs deep merge behavior for tables like lint.per-file-ignores.
docs/configuration.md
Improve CI integration docs to explain how exclusions interact with semantic checks and prevent false failures.
  • Add guidance on maintaining intentional divergences via the [tool.ruff-sync] exclude list in pyproject.toml.
  • Clarify that ruff-sync check respects the local exclude list and ignores those settings when comparing with upstream in CI.
docs/ci-integration.md
Update the MkDocs configuration to use a dedicated favicon asset.
  • Change theme favicon from logo.png to favicon.png to decouple the favicon from the main logo asset.
mkdocs.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

@Kilo59 Kilo59 self-assigned this Mar 16, 2026
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.

@github-actions
Copy link
Copy Markdown
Contributor

Wily: No changes in complexity detected.

@Kilo59 Kilo59 changed the title Docs/better usage Better usage section Mar 16, 2026
@Kilo59 Kilo59 changed the title Better usage section Docs: Better usage section Mar 16, 2026
@Kilo59 Kilo59 merged commit 37b3100 into main Mar 16, 2026
13 checks passed
@Kilo59 Kilo59 deleted the docs/better-usage branch March 16, 2026 21:55
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.60%. Comparing base (89b8993) to head (5f29a6f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #109   +/-   ##
=======================================
  Coverage   90.60%   90.60%           
=======================================
  Files           3        3           
  Lines         575      575           
=======================================
  Hits          521      521           
  Misses         54       54           

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

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