Skip to content

feat: Ruff formating and pre-commit ci for the codebase#2082

Merged
exploreriii merged 23 commits into
hiero-ledger:mainfrom
manishdait:feat/ruff-linting
Apr 14, 2026
Merged

feat: Ruff formating and pre-commit ci for the codebase#2082
exploreriii merged 23 commits into
hiero-ledger:mainfrom
manishdait:feat/ruff-linting

Conversation

@manishdait

Copy link
Copy Markdown
Contributor

Description:
This PR adds pre-commit hooks and GitHub Actions to enforce consistent code quality, security, and modern Python standards across the SDK.

Changes Made:

  • Added a GitHub Action to run pre-commit on all PRs.
  • Migrated to use Ruff formating and checks
  • Refactored code to use Python 3.10+ standards and sorted imports. (Mostly handle by Ruff)
  • Updated docsting for the methods and class
  • Updated docs on how to setup pre-commit

Related issue(s):

Fixes #2043

Notes for reviewer:

  • Logic remains the same; changes are strictly formatting and syntax modernization.
  • Initialy disable the -D docs check as some of our classes is currently missing the docstring.

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@manishdait manishdait added status: in initial development notes: extra care requires extra attention to detail or requirements labels Apr 7, 2026
@codecov

codecov Bot commented Apr 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.15385% with 29 lines in your changes missing coverage. Please review.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2082      +/-   ##
==========================================
- Coverage   93.70%   93.68%   -0.02%     
==========================================
  Files         145      145              
  Lines        9452     9426      -26     
==========================================
- Hits         8857     8831      -26     
  Misses        595      595              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codacy-production

codacy-production Bot commented Apr 7, 2026

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 4 medium

Alerts:
⚠ 4 issues (≤ 0 issues of at least minor severity)

Results:
4 new issues

Category Results
Complexity 4 medium

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

@manishdait
manishdait requested a review from parvninama April 8, 2026 10:14
@exploreriii exploreriii added this to the v0.2.5 milestone Apr 13, 2026
@github-actions github-actions Bot added skill: advanced requires knowledge of multiple areas in the codebase without defined steps to implement or examples scope: CI/CD involves continuous integration or delivery labels Apr 13, 2026
@exploreriii

Copy link
Copy Markdown
Contributor

i would not want to accept codacy's current changes for this PR! too much in one to refactor those.

@github-actions

Copy link
Copy Markdown

Hi, this is WorkflowBot.
Your pull request cannot be merged as it is not passing all our workflow checks.
Please click on each check to review the logs and resolve issues so all checks pass.
To help you:

@manishdait
manishdait marked this pull request as ready for review April 13, 2026 16:11
@manishdait
manishdait requested review from a team as code owners April 13, 2026 16:11
@exploreriii
exploreriii marked this pull request as draft April 13, 2026 17:01

@exploreriii exploreriii 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.

ci tests failing :(

@exploreriii
exploreriii marked this pull request as ready for review April 13, 2026 20:40
@exploreriii exploreriii added status: needs committer review reviewer: maintainer PR needs a review from the maintainer team priority: high High priority, needed soon and removed status: in initial development labels Apr 13, 2026

@exploreriii exploreriii 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.

Looks really great job, couple questions/notes

Comment thread docs/sdk_developers/training/transaction_lifecycle.md Outdated
Comment thread docs/sdk_developers/setup.md
Comment thread examples/consensus/topic_create_transaction_revenue_generating.py
Comment thread examples/tokens/token_create_transaction_token_metadata.py
Comment thread examples/transaction/transfer_transaction_nft.py
Comment thread src/hiero_sdk_python/transaction/transaction_record.py Outdated
Comment thread tests/tck/common_params_test.py
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Comment thread src/hiero_sdk_python/transaction/transaction_record.py
@exploreriii exploreriii added step: 2nd second stage of the review approval process and removed status: discussion a new proposed feature that should be discussed before proceeding reviewer: maintainer PR needs a review from the maintainer team notes: extra care requires extra attention to detail or requirements labels Apr 14, 2026
@exploreriii
exploreriii merged commit 59485de into hiero-ledger:main Apr 14, 2026
28 of 29 checks passed
@exploreriii

Copy link
Copy Markdown
Contributor

Thanks so much @manishdait

AntonioCeppellini pushed a commit to AntonioCeppellini/hiero-sdk-python that referenced this pull request Apr 22, 2026
parvninama pushed a commit to parvninama/hiero-sdk-python that referenced this pull request Apr 25, 2026
@manishdait
manishdait deleted the feat/ruff-linting branch June 5, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: high High priority, needed soon scope: CI/CD involves continuous integration or delivery skill: advanced requires knowledge of multiple areas in the codebase without defined steps to implement or examples step: 2nd second stage of the review approval process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Advanced]: Add Ruff hook and include in CI pipeline

3 participants