Skip to content

ci: add automated Ruff linting and formatting - #127

Open
Huoyanlifusu wants to merge 4 commits into
abhiksark:devfrom
Huoyanlifusu:feature/ci-add-linting
Open

ci: add automated Ruff linting and formatting#127
Huoyanlifusu wants to merge 4 commits into
abhiksark:devfrom
Huoyanlifusu:feature/ci-add-linting

Conversation

@Huoyanlifusu

@Huoyanlifusu Huoyanlifusu commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Related to #124.

This draft adds the initial Ruff configuration, CI checks, and local usage instructions.

While validating the change, I found that applying Ruff repository-wide exposes a large amount of existing style debt. It also reports expected errors in learner exercises, shared-namespace checks, and intentionally invalid test fixtures. I have intentionally not reformatted the repository or added extensive repository-specific exclusions yet, to keep this PR focused.

Tests

zhangyuyang@zhangyuyangdeMacBook-Pro pythonlings % python -m pytest -q
.......................................................................................................................................................................... [ 80%]
..........................................                                                                                                                                 [100%]
212 passed in 40.27s

Screenshots

Checklist

  • Updated docs when behavior changed
  • Added or updated tests
  • Verified python -m pytest -q

Signed-off-by: zhangyuyang <zhangyuyang821@163.com>
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a3b3869a-b834-47d9-8fa1-9846158ff632

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Huoyanlifusu

Copy link
Copy Markdown
Contributor Author

@abhiksark Before making the CI check required, would you confirm whether you prefer:

  1. establishing a repository-wide Ruff formatting baseline in this PR; excluding curriculum and fixture paths; or
  2. introducing Ruff incrementally and handling the existing violations in a follow-up issue?

@abhiksark

Copy link
Copy Markdown
Owner

2nd makes more sense.

@abhiksark
abhiksark self-requested a review August 21, 2026 05:17
@abhiksark abhiksark added enhancement New feature or request area: ci Continuous integration and automation size: S Small, focused contribution labels Aug 21, 2026
@abhiksark

Copy link
Copy Markdown
Owner

Thanks for putting together the initial Ruff configuration and contributor documentation. The focused scope, Python 3.9 target, 80-character limit, and development-only dependency all look good.

There is one blocker before this can merge: the lint job sets up Python but never installs Ruff. The current Actions log shows both commands failing with ruff: command not found; because each step has continue-on-error: true, the job still appears green even though Ruff never runs.

Please add a non-advisory installation step before the checks, for example:

- name: Install development dependencies
  run: python -m pip install -e ".[dev]"

The two Ruff commands can remain advisory for this incremental phase. After making that change, please update the branch from the current dev and rerun CI, since the branch is currently behind the latest multi-platform workflow.

One non-blocking note: the current configuration reports substantial existing debt, including expected shared-namespace errors in checks/. That is reasonable for temporary advisory scaffolding, but it does not yet satisfy #124's final requirement that lint failures block CI. Keeping this PR as “related to #124” and handling the baseline/per-file ignores in follow-up work makes sense.

@Huoyanlifusu

Copy link
Copy Markdown
Contributor Author

@abhiksark Thanks! I’ve added the development dependency installation step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci Continuous integration and automation enhancement New feature or request size: S Small, focused contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: add automated style linting (ruff) so style issues are caught before review

2 participants