-
Notifications
You must be signed in to change notification settings - Fork 142
feat: update pyproject.toml with ruff settings #1357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Shivakumar <shivakumarjagadish12@gmail.com>
📝 WalkthroughWalkthroughUpdated project configuration and changelog: expanded Ruff lint/format and pydocstyle settings, set target Python version, adjusted project metadata (license, classifiers, pdm formatting), removed the upper bound on Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks✅ Passed checks (5 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
⏰ 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). (1)
🔇 Additional comments (5)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
CHANGELOG.mdpyproject.toml
⏰ 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). (1)
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (6)
CHANGELOG.md (1)
137-137: LGTM! Changelog entry accurately documents the changes.The changelog entry properly documents the addition of stricter Ruff linting rules to pyproject.toml, including the key rule groups (D, I, UP) that were added.
pyproject.toml (5)
74-76: LGTM! Ruff base configuration is appropriate.The Ruff base configuration is well-structured:
line-length = 120is a reasonable standardtarget-version = "py310"correctly matches the project's minimum Python version requirement
79-91: LGTM! Comprehensive and well-documented lint rule selection.The selected Ruff lint rules are comprehensive and well-chosen for enforcing code quality:
- Documentation (D), style (E, F), imports (I), bugs (B), modernization (UP)
- Code simplification (SIM), performance (PERF), dead code detection (ARG)
- Consistency checks (RET, RSE)
The inline comments explaining each rule group are helpful for maintainability.
98-100: LGTM! Ruff format configuration follows Python conventions.The formatting configuration is appropriate:
quote-style = "double"follows Python community conventionsindent-style = "space"aligns with PEP 8 requirements
102-103: LGTM! Google docstring convention matches PR objectives.Setting
convention = "google"aligns perfectly with the PR objectives from issue #1244 to enforce Google-style docstrings throughout the codebase.
44-44: All specified dependency versions exist and are stable.Verification confirms:
pytest-cov>=7.0.0: Latest release is 7.0.0 (Sep 9, 2025)ruff>=0.14.9: Latest release is 0.14.10 (Dec 18, 2025)typing-extensions>=4.15.0: Latest release is 4.15.0 (Aug 25, 2025)All versions have been publicly available for several months and are suitable for production use. No blocking concerns.
Likely an incorrect or invalid review comment.
Signed-off-by: Shivakumar <shivakumarjagadish12@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
pyproject.toml
⏰ 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). (1)
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (6)
pyproject.toml (6)
13-13: LGTM: License field formatting normalized.The license field now uses the modern
{ file = "LICENSE" }format, which is the recommended approach in PEP 621.
22-22: LGTM: Dependency update addresses security vulnerability.The
requests>=2.32.4requirement addresses CVE-2024-47081 that affected version 2.32.3. Removing the upper bound is a good practice for flexibility with patch releases.
76-76: LGTM: Target version aligns with project requirements.Setting
target-version = "py310"correctly matches the project's minimum Python version (requires-python = ">=3.10"), ensuring Ruff provides version-appropriate linting suggestions.
79-91: LGTM: Comprehensive lint rule selection improves code quality.The expanded rule selection covers essential areas:
- Documentation (D), imports (I), and modern syntax (UP)
- Bug detection (B) and performance (PERF)
- Code patterns (ARG, RET, RSE) and simplification (SIM)
This configuration aligns with issue #1244 requirements and will help maintain consistent, high-quality code.
97-99: LGTM: Standard formatting configuration.The formatter configuration uses conventional Python style:
- Double quotes for strings
- Space-based indentation
This ensures consistent code formatting across the project.
101-102: LGTM: Google docstring convention configured.Setting
convention = "google"establishes a clear documentation standard for the project. This works well with the D212 ignore, as Google-style docstrings typically use multi-line summaries.
Signed-off-by: Shivakumar <shivakumarjagadish12@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
pyproject.toml
⏰ 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). (1)
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (6)
pyproject.toml (6)
22-22: Security vulnerability fix confirmed.The update to
requests>=2.32.4correctly addresses CVE-2024-47081 identified in previous reviews.
41-49: LGTM: Dependency groups properly configured.The dev and lint dependency groups are well-structured with appropriate version constraints and formatting.
73-75: LGTM: Ruff basic configuration matches requirements.The line-length and target-version settings correctly implement the requirements from issue #1244.
78-90: LGTM: Ruff lint rules properly configured.All required rule groups from issue #1244 are enabled with clear, helpful comments documenting each group's purpose.
97-99: LGTM: Ruff formatter configuration matches requirements.The quote-style and indent-style settings correctly implement the requirements from issue #1244.
101-102: LGTM: Pydocstyle convention correctly configured.The Google-style docstring convention setting correctly implements the requirement from issue #1244.
Signed-off-by: Shivakumar <shivakumarjagadish12@gmail.com>
|
Request help @hiero-ledger/hiero-sdk-python-triage to test this and check all is as expected |
aceppaluni
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@drtoxic69
Thanks for the PR — this is a solid modernization of our linting setup 👍
I reviewed the Ruff configuration in detail:
- Rule selection is well-balanced and focuses on correctness, maintainability, and modern Python without being overly opinionated.
- target-version = py310 correctly matches our declared Python support.
- The B008 and E501 ignores are justified and clearly documented.
- Google-style docstrings are explicitly configured, which removes ambiguity for contributors.
I also verified that no existing pyproject.toml tooling (pdm, uv, dependency groups) was unintentionally removed or altered.
CI passing with these stricter rules is a good signal that this won’t introduce churn.
Waiting for further review from @hiero-ledger/hiero-sdk-python-triage
AntonioCeppellini
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This a cool addition for us :D, seems nice to me!
can't say anything more than @aceppaluni
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #1357 +/- ##
=======================================
Coverage 92.29% 92.29%
=======================================
Files 139 139
Lines 8515 8515
=======================================
Hits 7859 7859
Misses 656 656 🚀 New features to boost your workflow:
|
aceppaluni
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@drtoxic69 Super awesome work!
|
Hi @drtoxic69 thank you so much for this contribution and sorrry it took a long time to review. |
Description:
This PR modernizes the project's tooling configuration by updating
pyproject.tomlwith stricter Ruff settings, as requested in the issue. This standardizes our code style with Google-style docstrings, import sorting, and modern Python syntax.Fixes #1244
Changes:
pyproject.tomlcontent with the provided configuration.D(Docstrings),I(Import sort),UP(pyupgrade),B(Bugbear), and more.google.py310.Checklist