Skip to content

fix: Add lint:py-fix as a sub-task of lint:fix; Update README to include all lint tasks. - #181

Merged
sitaowang1998 merged 66 commits into
y-scope:mainfrom
sitaowang1998:pylinter-readme
Aug 7, 2025
Merged

fix: Add lint:py-fix as a sub-task of lint:fix; Update README to include all lint tasks.#181
sitaowang1998 merged 66 commits into
y-scope:mainfrom
sitaowang1998:pylinter-readme

Conversation

@sitaowang1998

@sitaowang1998 sitaowang1998 commented Aug 6, 2025

Copy link
Copy Markdown
Collaborator

Description

Note

This PR depends on #176.

As title.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

  • The overall fix lint task executed python fix task.
  • GitHub workflows pass.

Summary by CodeRabbit

  • Documentation

    • Updated README to include new Python linting commands and refined C++ lint task descriptions with improved table formatting.
  • Chores

    • Added a new Python fix task to the linting workflow.

sitaowang1998 and others added 30 commits July 15, 2025 13:40
Co-authored-by: Lin Zhihao <59785146+LinZhihao-723@users.noreply.github.com>
…ider into dep-concurrency"

This reverts commit 1769c95, reversing
changes made to 90aa5a2.
@sitaowang1998
sitaowang1998 requested a review from a team as a code owner August 6, 2025 20:03
@coderabbitai

coderabbitai Bot commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@sitaowang1998 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 29 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 6ac3de8 and cde2b0e.

📒 Files selected for processing (1)
  • README.md (1 hunks)

Walkthrough

The documentation and configuration for linting tasks were updated. The README now lists additional Python linting commands (lint:py-check and lint:py-fix). The description for the C++ static fix task was modified to remove mention of automatic fixes. In the lint-tasks YAML, a Python fix task was added to the fix group. No logic or control flow changes were introduced.

Changes

Cohort / File(s) Change Summary
README Linting Commands
README.md
Updated linting tasks table to include Python check/fix commands; modified C++ static fix description; improved table formatting.
Lint Task Configuration
lint-tasks.yaml
Added py-fix task to the fix group alongside existing fix tasks.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Possibly related PRs

Suggested reviewers

  • LinZhihao-723
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
requirements-dev.txt (1)

6-8: Consider pinning tombi to a stable minor to avoid unexpected breakages

>=0.4.35 guarantees the features you need (e.g., tombi:// catalog URLs), but future 0.x releases can introduce breaking changes without a major-version bump. Pinning to ~0.4.35 or >=0.4.35,<0.5 would give you the new functionality while limiting risk.

lint-tasks.yaml (1)

171-188: Minor duplication but harmless

toml-fix runs tombi lint even though tombi format will re-lint after formatting. Dropping the first call would shave seconds off CI without losing coverage.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 890827b and 11dac91.

📒 Files selected for processing (6)
  • README.md (1 hunks)
  • lint-tasks.yaml (2 hunks)
  • requirements-dev.txt (1 hunks)
  • ruff.toml (1 hunks)
  • tests/integration/utils.py (0 hunks)
  • tombi.toml (1 hunks)
💤 Files with no reviewable changes (1)
  • tests/integration/utils.py
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: sitaowang1998
PR: y-scope/spider#172
File: tombi.toml:7-10
Timestamp: 2025-08-03T02:01:57.863Z
Learning: There may be discrepancies in publicly available documentation about tombi TOML linter rule identifiers. When in doubt, defer to the project maintainer's knowledge of the official documentation and test the configuration to ensure it works correctly.
Learnt from: sitaowang1998
PR: y-scope/spider#172
File: tombi.toml:7-10
Timestamp: 2025-08-03T02:01:57.863Z
Learning: In tombi TOML linter configuration, the correct rule identifier for checking empty keys is `key-empty`. The command `tombi --help rules` does not exist. The official documentation is available at https://tombi-toml.github.io/tombi/docs/configuration/.
Learnt from: sitaowang1998
PR: y-scope/spider#172
File: tombi.toml:7-10
Timestamp: 2025-08-03T02:01:57.863Z
Learning: In tombi TOML linter configuration, the correct rule identifier for checking empty keys is `key-empty`, not `keys-empty`. This is documented at https://tombi-toml.github.io/tombi/docs/configuration/.
Learnt from: sitaowang1998
PR: y-scope/spider#180
File: tombi.toml:17-22
Timestamp: 2025-08-06T13:48:53.787Z
Learning: In tombi TOML linter version 0.4.35 and later, the pseudo-scheme "tombi://" supports external host references like "tombi://json.schemastore.org/api/json/catalog.json" in addition to built-in identifiers. This expanded functionality allows referencing external schema catalogs using the tombi:// scheme, which was not supported in earlier versions.
Learnt from: sitaowang1998
PR: y-scope/spider#172
File: tombi.toml:7-10
Timestamp: 2025-08-03T02:01:57.863Z
Learning: The tombi TOML linter uses `key-empty` as the correct rule identifier for checking empty keys. This can be verified by testing with `tombi lint` command, which will successfully process configurations using this rule identifier. The rule `keys-empty` does not exist in tombi.
📚 Learning: ensure to carefully check yaml indentation before suggesting fixes, and avoid removing comments unle...
Learnt from: kirkrodrigues
PR: y-scope/spider#1
File: .github/workflows/pr-title.yaml:11-15
Timestamp: 2024-10-23T02:23:12.161Z
Learning: Ensure to carefully check YAML indentation before suggesting fixes, and avoid removing comments unless necessary.

Applied to files:

  • ruff.toml
📚 Learning: there may be discrepancies in publicly available documentation about tombi toml linter rule identifi...
Learnt from: sitaowang1998
PR: y-scope/spider#172
File: tombi.toml:7-10
Timestamp: 2025-08-03T02:01:57.863Z
Learning: There may be discrepancies in publicly available documentation about tombi TOML linter rule identifiers. When in doubt, defer to the project maintainer's knowledge of the official documentation and test the configuration to ensure it works correctly.

Applied to files:

  • ruff.toml
  • README.md
  • tombi.toml
  • lint-tasks.yaml
📚 Learning: in tombi toml linter version 0.4.35 and later, the pseudo-scheme "tombi://" supports external host r...
Learnt from: sitaowang1998
PR: y-scope/spider#180
File: tombi.toml:17-22
Timestamp: 2025-08-06T13:48:53.787Z
Learning: In tombi TOML linter version 0.4.35 and later, the pseudo-scheme "tombi://" supports external host references like "tombi://json.schemastore.org/api/json/catalog.json" in addition to built-in identifiers. This expanded functionality allows referencing external schema catalogs using the tombi:// scheme, which was not supported in earlier versions.

Applied to files:

  • tombi.toml
  • lint-tasks.yaml
📚 Learning: in tombi toml linter configuration, the correct rule identifier for checking empty keys is `key-empt...
Learnt from: sitaowang1998
PR: y-scope/spider#172
File: tombi.toml:7-10
Timestamp: 2025-08-03T02:01:57.863Z
Learning: In tombi TOML linter configuration, the correct rule identifier for checking empty keys is `key-empty`. The command `tombi --help rules` does not exist. The official documentation is available at https://tombi-toml.github.io/tombi/docs/configuration/.

Applied to files:

  • tombi.toml
  • lint-tasks.yaml
📚 Learning: in tombi toml linter configuration, the correct rule identifier for checking empty keys is `key-empt...
Learnt from: sitaowang1998
PR: y-scope/spider#172
File: tombi.toml:7-10
Timestamp: 2025-08-03T02:01:57.863Z
Learning: In tombi TOML linter configuration, the correct rule identifier for checking empty keys is `key-empty`, not `keys-empty`. This is documented at https://tombi-toml.github.io/tombi/docs/configuration/.

Applied to files:

  • tombi.toml
  • lint-tasks.yaml
📚 Learning: the tombi toml linter uses `key-empty` as the correct rule identifier for checking empty keys. this ...
Learnt from: sitaowang1998
PR: y-scope/spider#172
File: tombi.toml:7-10
Timestamp: 2025-08-03T02:01:57.863Z
Learning: The tombi TOML linter uses `key-empty` as the correct rule identifier for checking empty keys. This can be verified by testing with `tombi lint` command, which will successfully process configurations using this rule identifier. The rule `keys-empty` does not exist in tombi.

Applied to files:

  • tombi.toml
  • lint-tasks.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: lint
  • GitHub Check: non-storage-unit-tests (ubuntu-24.04)
  • GitHub Check: non-storage-unit-tests (ubuntu-22.04)
🔇 Additional comments (4)
ruff.toml (1)

7-23: Indentation clean-up looks good

Only whitespace was adjusted; semantic content is unchanged.

tombi.toml (2)

1-6: Verify top-level key name

Most examples use version = "1" (or similar) instead of toml-version. If tombi doesn’t recognise toml-version, the file will be ignored and CI will fail. Please run tombi lint locally to confirm the key is accepted.


11-14: Rule set aligns with previous guidance

key-empty is the correct identifier; good catch.

lint-tasks.yaml (1)

159-170: Nice addition of TOML lint & format tasks

The split between toml-lint and toml-format mirrors the Python flow and keeps things consistent.

Comment thread README.md Outdated
@sitaowang1998 sitaowang1998 changed the title chore: Add python lint tasks in README. chore: Add Python fix to overall fix lint task; Add Python lint tasks in README. Aug 6, 2025

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🔭 Outside diff range comments (2)
lint-tasks.yaml (2)

160-170: ❗ Unresolved merge-conflict markers make the Taskfile invalid YAML

<<<<<<< HEAD … ======= … >>>>>>> main blocks are still present.
Their presence:

  1. Breaks YAML parsing (confirmed by yamllint error and CI failure).
  2. Causes the toml-check / toml-format tasks to reference both FLAGS and TOMBI_FORMAT_FLAGS, leading to ambiguous variable names.

Minimal, conflict-free resolution:

   toml-check:
     cmds:
       - task: "toml-lint"
       - task: "toml-format"
-<<<<<<< HEAD
-        vars:
-          TOMBI_FORMAT_FLAGS: "--check"
-=======
-        vars:
-          FLAGS: "--check"
->>>>>>> main
+        vars:
+          TOMBI_FORMAT_FLAGS: "--check"
 …
   toml-format:
     internal: true
     deps: ["venv"]
-<<<<<<< HEAD
-    vars:
-      TOMBI_FORMAT_FLAGS: "{{.TOMBI_FORMAT_FLAGS | default \"\"}}"
-    cmds:
-      - |-
-        . "{{.G_LINT_VENV_DIR}}/bin/activate"
-        tombi format {{.TOMBI_FORMAT_FLAGS}} "{{.ROOT_DIR}}"
-=======
-    vars:
-      FLAGS: "{{.FLAGS | default \"\"}}"
-    cmds:
-      - |-
-        . "{{.G_LINT_VENV_DIR}}/bin/activate"
-        tombi format {{.FLAGS}} "{{.ROOT_DIR}}"
->>>>>>> main
+    vars:
+      TOMBI_FORMAT_FLAGS: "{{.TOMBI_FORMAT_FLAGS | default \"\"}}"
+    cmds:
+      - |-
+        . "{{.G_LINT_VENV_DIR}}/bin/activate"
+        tombi format {{.TOMBI_FORMAT_FLAGS}} "{{.ROOT_DIR}}"

Resolve the conflict and push a clean file; otherwise every downstream task will fail at runtime.

Also applies to: 188-200


132-139: Python lint scope limited to tests/integration only

The for loop iterates solely over the tests/integration directory. Source files (e.g., src/, tools/, root scripts) escape MyPy and Ruff completely, undermining the new lint step.

Consider parameterising the iterable:

-  - for:
-      - "tests/integration"
+  - for:
+      - "src"
+      - "tests"
+      - "tools"
+      - "taskfile.yaml"

or introduce a glob pattern to cover all .py files.

Without widening the scope, the added py-check/py-fix tasks provide little value.

🧹 Nitpick comments (1)
lint-tasks.yaml (1)

119-124: py-fix triggers formatting but not format fixes

Inside py the sequence is:

ruff check {{.RUFF_CHECK_FLAGS}} …
ruff format {{.RUFF_FORMAT_FLAGS}} …

py-fix passes only --fix to RUFF_CHECK_FLAGS, so ruff format still runs but with no flags, meaning it shows diff-less output rather than applying changes. If the intention is to auto-apply formatting as well, add --unsafe-fixes (or - no-flag) to RUFF_FORMAT_FLAGS.

-      - task: "py"
-        vars:
-          RUFF_CHECK_FLAGS: "--fix"
+      - task: "py"
+        vars:
+          RUFF_CHECK_FLAGS: "--fix"
+          RUFF_FORMAT_FLAGS: "--unsafe-fixes"

Optional but prevents half-fixed code.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fba7429 and 33c876c.

📒 Files selected for processing (1)
  • lint-tasks.yaml (3 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: sitaowang1998
PR: y-scope/spider#172
File: tombi.toml:7-10
Timestamp: 2025-08-03T02:01:57.863Z
Learning: There may be discrepancies in publicly available documentation about tombi TOML linter rule identifiers. When in doubt, defer to the project maintainer's knowledge of the official documentation and test the configuration to ensure it works correctly.
Learnt from: sitaowang1998
PR: y-scope/spider#172
File: tombi.toml:7-10
Timestamp: 2025-08-03T02:01:57.863Z
Learning: In tombi TOML linter configuration, the correct rule identifier for checking empty keys is `key-empty`. The command `tombi --help rules` does not exist. The official documentation is available at https://tombi-toml.github.io/tombi/docs/configuration/.
Learnt from: sitaowang1998
PR: y-scope/spider#172
File: tombi.toml:7-10
Timestamp: 2025-08-03T02:01:57.863Z
Learning: In tombi TOML linter configuration, the correct rule identifier for checking empty keys is `key-empty`, not `keys-empty`. This is documented at https://tombi-toml.github.io/tombi/docs/configuration/.
📚 Learning: there may be discrepancies in publicly available documentation about tombi toml linter rule identifi...
Learnt from: sitaowang1998
PR: y-scope/spider#172
File: tombi.toml:7-10
Timestamp: 2025-08-03T02:01:57.863Z
Learning: There may be discrepancies in publicly available documentation about tombi TOML linter rule identifiers. When in doubt, defer to the project maintainer's knowledge of the official documentation and test the configuration to ensure it works correctly.

Applied to files:

  • lint-tasks.yaml
📚 Learning: in tombi toml linter configuration, the correct rule identifier for checking empty keys is `key-empt...
Learnt from: sitaowang1998
PR: y-scope/spider#172
File: tombi.toml:7-10
Timestamp: 2025-08-03T02:01:57.863Z
Learning: In tombi TOML linter configuration, the correct rule identifier for checking empty keys is `key-empty`. The command `tombi --help rules` does not exist. The official documentation is available at https://tombi-toml.github.io/tombi/docs/configuration/.

Applied to files:

  • lint-tasks.yaml
🪛 YAMLlint (1.37.1)
lint-tasks.yaml

[error] 166-166: syntax error: could not find expected ':'

(syntax)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: lint
  • GitHub Check: non-storage-unit-tests (ubuntu-24.04)
  • GitHub Check: non-storage-unit-tests (ubuntu-22.04)
🔇 Additional comments (1)
lint-tasks.yaml (1)

19-22: 👍 py-fix correctly added to the global fix pipeline

fix.cmds now triggers automatic Python fixes alongside CMake and C++. Nice catch; this keeps parity with the new py-fix task.

Comment thread README.md

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A few things to change:

  • some violations -> any violations
  • We should sort tasks in the lexical order: toml comes after py.
  • cpp-static-fix and yml-fix don't actually fix anything. We should just drop "fixes xxx".

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As discussed offline, let's use some violations when not all violations can be fixed, and use any violations otherwise. That said, we should change cpp-format-fix to use any violations.

@LinZhihao-723 LinZhihao-723 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For the PR title, how about:

fix: Add `lint:py-fix` as a sub-task of `lint:fix`; Update README to include all lint tasks.

@sitaowang1998 sitaowang1998 changed the title chore: Add Python fix to overall fix lint task; Add Python lint tasks in README. fix: Add lint:py-fix as a sub-task of lint:fix; Update README to include all lint tasks. Aug 7, 2025
@sitaowang1998
sitaowang1998 merged commit 7eb1abe into y-scope:main Aug 7, 2025
5 checks passed
@sitaowang1998
sitaowang1998 deleted the pylinter-readme branch August 7, 2025 01:40
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.

2 participants