Skip to content

chore: enable isort ruff rule and apply fixes #5003

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Aswinr24
Copy link
Contributor

@Aswinr24 Aswinr24 commented May 4, 2025

Description

This PR enables additional Ruff linting rules and applies fixes to the codebase as suggested by Ruff. The changes include:

Enabling I (isort) rule in pyproject.toml.

fixes issues raised by ruff linter which included:

  • I001: Ensure consistent and standardized sorting of top-level imports across files.

Related to #4925

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #)

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Important checks:

Please confirm the following before marking the PR as ready for review:

  • No style issues: nox -s pre-commit
  • All tests pass: nox -s tests
  • The documentation builds: nox -s doctests
  • Code is commented for hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@Aswinr24 Aswinr24 requested a review from a team as a code owner May 4, 2025 19:42
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link

codecov bot commented May 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.57%. Comparing base (a1f2134) to head (2efc083).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5003      +/-   ##
===========================================
- Coverage    98.57%   98.57%   -0.01%     
===========================================
  Files          304      304              
  Lines        23661    23655       -6     
===========================================
- Hits         23325    23319       -6     
  Misses         336      336              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@agriyakhetarpal
Copy link
Member

Hi @Aswinr24, could you please resolve the merge conflicts here? Thanks!

Also, as this is a linting-only change and performs no changes in functionality, we should leave the commit hash for the changes in the .git-blame-ignore-revs file.

What can be done here is:

  • rebase the PR on top of the develop branch
  • resolve all the conflicts that are currently present and get pre-commit checks to pass
  • squash all the changes into one commit, say, commit X
  • in a second commit Y, add the SHA for commit X in .git-blame-ignore-revs

Here is an article that should serve as helpful reading: https://graphite.dev/guides/git-blame-ignore-revs

We can then merge the PR (not squash-merge, but a regular merge).

@kratman
Copy link
Contributor

kratman commented May 9, 2025

Hi @Aswinr24, could you please resolve the merge conflicts here? Thanks!

Also, as this is a linting-only change and performs no changes in functionality, we should leave the commit hash for the changes in the .git-blame-ignore-revs file.

What can be done here is:

  • rebase the PR on top of the develop branch
  • resolve all the conflicts that are currently present and get pre-commit checks to pass
  • squash all the changes into one commit, say, commit X
  • in a second commit Y, add the SHA for commit X in .git-blame-ignore-revs

Here is an article that should serve as helpful reading: https://graphite.dev/guides/git-blame-ignore-revs

We can then merge the PR (not squash-merge, but a regular merge).

Since this is just changing the order of the import statements, we can probably skip the ignore-revs part

@agriyakhetarpal
Copy link
Member

Hi @Aswinr24, could you please resolve the merge conflicts here? Thanks!
Also, as this is a linting-only change and performs no changes in functionality, we should leave the commit hash for the changes in the .git-blame-ignore-revs file.
What can be done here is:

  • rebase the PR on top of the develop branch
  • resolve all the conflicts that are currently present and get pre-commit checks to pass
  • squash all the changes into one commit, say, commit X
  • in a second commit Y, add the SHA for commit X in .git-blame-ignore-revs

Here is an article that should serve as helpful reading: graphite.dev/guides/git-blame-ignore-revs
We can then merge the PR (not squash-merge, but a regular merge).

Since this is just changing the order of the import statements, we can probably skip the ignore-revs part

I'm not sure I follow – changing the order of the import statements is a style-only change and is not useful at all in the git blame, i.e., it rather provides a reason to add it to the ignore-revs file instead of not doing so?

@Aswinr24
Copy link
Contributor Author

Hi @Aswinr24, could you please resolve the merge conflicts here? Thanks!

Also, as this is a linting-only change and performs no changes in functionality, we should leave the commit hash for the changes in the .git-blame-ignore-revs file.

What can be done here is:

  • rebase the PR on top of the develop branch
  • resolve all the conflicts that are currently present and get pre-commit checks to pass
  • squash all the changes into one commit, say, commit X
  • in a second commit Y, add the SHA for commit X in .git-blame-ignore-revs

Here is an article that should serve as helpful reading: https://graphite.dev/guides/git-blame-ignore-revs

We can then merge the PR (not squash-merge, but a regular merge).

Thanks! Yes, will resolve the merge conflicts and do the necessary changes.

@kratman kratman enabled auto-merge May 20, 2025 19:50
@kratman kratman disabled auto-merge May 20, 2025 20:05
Copy link
Contributor

Choose a reason for hiding this comment

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

This file was deleted in #4996

Can you remove this version of it and re-do the rebase

Copy link
Contributor

Choose a reason for hiding this comment

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

Sometimes with formatting changes like these, the best approach is to hard reset to the base branch, then re-apply the pre-commit. It is safer than merging and squashing since that modifies history

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure will fix this

Copy link
Contributor

@kratman kratman left a comment

Choose a reason for hiding this comment

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

A file was mistakenly re-added. This was caught by the docs tests

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.

3 participants