Skip to content

Conversation

@drtoxic69
Copy link
Contributor

Description:
This PR modernizes the project's tooling configuration by updating pyproject.toml with 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:

  • Configuration: Replaced pyproject.toml content with the provided configuration.
    • Enabled rules: D (Docstrings), I (Import sort), UP (pyupgrade), B (Bugbear), and more.
    • Set docstring convention to google.
    • Set target version to py310.

Checklist

  • Changelog entry added.
  • Commits are signed.
  • All tests pass.

Signed-off-by: Shivakumar <shivakumarjagadish12@gmail.com>
@coderabbitai
Copy link

coderabbitai bot commented Jan 5, 2026

📝 Walkthrough

Walkthrough

Updated 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 requests, and added a changelog entry documenting these changes.

Changes

Cohort / File(s) Summary
Changelog Entry
CHANGELOG.md
Added entry documenting updated Ruff linting/configuration and related metadata/dependency edits.
Project configuration
pyproject.toml
Normalized license to license = { file = "LICENSE" }; removed upper bound on requests ("requests>=2.32.4,<=2.32.5""requests>=2.32.4"); adjusted classifiers and minor formatting in [tool.pdm] version entry; added trailing comma in dev deps.
Ruff / lint config
pyproject.toml
Added [tool.ruff] target-version = "py310" and line-length; expanded [tool.ruff.lint].select (D, E, F, I, B, UP, SIM, PERF, ARG, RET, RSE); added ignore entries (D212, E501, B008); added [tool.ruff.format] (quote-style = "double", indent-style = "space"); added [tool.ruff.lint.pydocstyle] convention = "google".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'feat: update pyproject.toml with ruff settings' accurately summarizes the main change: adding and configuring Ruff linting rules in pyproject.toml.
Description check ✅ Passed The PR description is directly related to the changeset, explaining the Ruff configuration updates, enabled rules, and docstring conventions being implemented in pyproject.toml.
Linked Issues check ✅ Passed The PR successfully addresses all coding requirements from issue #1244: configured [tool.ruff] with line-length=120 and target-version=py310; configured [tool.ruff.lint].select with D,E,F,I,B,UP,SIM,PERF,ARG,RET,RSE; configured [tool.ruff.lint].ignore with D212,E501,B008; configured [tool.ruff.format] with quote-style='double' and indent-style='space'; configured [tool.ruff.lint.pydocstyle] with convention='google'; and added a CHANGELOG.md entry.
Out of Scope Changes check ✅ Passed The changes are mostly in scope, but minor unrelated modifications exist: the 'requests' dependency constraint was loosened, the classifier was simplified, and the PDM version formatting was adjusted—these appear incidental to the primary Ruff configuration objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c693732 and 1d35a4e.

📒 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 (5)
pyproject.toml (5)

22-22: Good security fix applied.

The requests dependency has been correctly updated to >=2.32.4, addressing CVE-2024-47081 from the previous review. Removing the upper bound also improves flexibility for future security patches.


73-90: LGTM! Ruff configuration matches issue requirements.

The Ruff configuration correctly implements all requirements from issue #1244:

  • line-length = 120
  • target-version = "py310"
  • ✓ All required lint rules enabled (D, E, F, I, B, UP, SIM, PERF, ARG, RET, RSE)

The inline comments are helpful for understanding each rule group's purpose.


97-99: LGTM! Format configuration matches requirements.

The Ruff format settings correctly implement issue #1244 requirements:

  • quote-style = "double"
  • indent-style = "space"

101-102: LGTM! Pydocstyle configuration matches requirements.

The pydocstyle configuration correctly implements issue #1244 requirement:

  • convention = "google"

46-48: Package versions are valid and compatible.

Both ruff>=0.14.9 (latest: 0.14.10) and typing-extensions>=4.15.0 (latest: 4.15.0) are available and compatible with the project's Python requirement of >=3.10, <3.14.


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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between 7f35aef and 78fa1ab.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • 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)
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 = 120 is a reasonable standard
  • target-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 conventions
  • indent-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>
Copy link

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between 78fa1ab and b9c3a0b.

📒 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.4 requirement 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>
Copy link

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between b9c3a0b and c693732.

📒 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.4 correctly 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>
@exploreriii
Copy link
Contributor

Request help @hiero-ledger/hiero-sdk-python-triage to test this and check all is as expected
Will take me a little more time to review this carefully.

Copy link
Contributor

@aceppaluni aceppaluni left a 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

Copy link
Member

@AntonioCeppellini AntonioCeppellini left a 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
Copy link

codecov bot commented Jan 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@exploreriii exploreriii requested a review from manishdait January 6, 2026 22:38
Copy link
Contributor

@aceppaluni aceppaluni left a 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!

@exploreriii exploreriii merged commit 4f4767a into hiero-ledger:main Jan 6, 2026
21 of 22 checks passed
@exploreriii
Copy link
Contributor

Hi @drtoxic69 thank you so much for this contribution and sorrry it took a long time to review.
Appreciate your help and your patience

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.

[Good First Issue]: Add ruff settings to pyproject toml

4 participants