Skip to content
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

Update ruff rules to ignore unused imports in __init__.py files #177

Merged
merged 3 commits into from
Nov 3, 2023

Conversation

CunliangGeng
Copy link
Member

When using ruff to automatically fix code, it will remove all unused imports. However, the imports in __init__.py might be unused if they are not used in e.g. __all__ variable. But we want to keep unused imports in init files. So set ignore-init-module-imports to true in this PR.

Major changes

  • add ignore-init-module-imports = true for ruff config
  • add back unused imports that were removed with ruff fix
  • fix a failed unit test that was not noticed in former PR

@CunliangGeng CunliangGeng requested a review from gcroci2 November 3, 2023 11:15
@CunliangGeng CunliangGeng merged commit 4016a64 into dev Nov 3, 2023
2 of 3 checks passed
@CunliangGeng CunliangGeng deleted the update_ruff_rules branch November 3, 2023 13:08
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