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

Audit & clean up import statements application-wide #17725

Closed
jeremystretch opened this issue Oct 10, 2024 · 1 comment · Fixed by #17728
Closed

Audit & clean up import statements application-wide #17725

jeremystretch opened this issue Oct 10, 2024 · 1 comment · Fixed by #17728
Assignees
Labels
status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user

Comments

@jeremystretch
Copy link
Member

jeremystretch commented Oct 10, 2024

Proposed Changes

Audit the code base with ruff to clean up import statements:

  • Remove unused imports (F401)
  • Replace wildcard (*) imports with explicit lists (F403, F405)

Justification

General housekeeping and improvements to code quality

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user labels Oct 10, 2024
@jeremystretch jeremystretch self-assigned this Oct 10, 2024
jeremystretch added a commit that referenced this issue Oct 10, 2024
@jeremystretch
Copy link
Member Author

It doesn't seem that there's sufficient tangible benefit of removing wildcard imports to justify the effort involved. Instead, we could simply ensure that any module which is imported using a wildcard declares __all__, to ensure only expected resources are imported. (This is already true for most relevant modules.)

bctiemann pushed a commit that referenced this issue Oct 11, 2024
* #17725: Resolve all F401 errors

* Tweak noqa designation
jeremystretch added a commit to alehaa/netbox that referenced this issue Oct 11, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant