Skip to content

ci: Re-enable flake8's F401 rule: no unused imports#180

Merged
romanc merged 1 commit into
NOAA-GFDL:developfrom
romanc:romanc/flake8-cleanup
Jul 21, 2025
Merged

ci: Re-enable flake8's F401 rule: no unused imports#180
romanc merged 1 commit into
NOAA-GFDL:developfrom
romanc:romanc/flake8-cleanup

Conversation

@romanc
Copy link
Copy Markdown
Collaborator

@romanc romanc commented Jul 18, 2025

Description

Follow-up PR from #159, which accidentally added an exception for F401 (no unused imports) for all files. It turns out, we can re-enable this rule for all files if we populate the __all__ variable in __init__.py files, simplifying configuration.

I've also commented on why we have the other exceptions and grouped them by "redundant with black" and "clashing with NDSL/stencil syntax".

How Has This Been Tested?

Running pre-commit locally.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation: N/A
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules: N/A
  • New check tests, if applicable, are included

Update `__init__.py` files to use populate the `__all__` variable. That
way, we don't need to handle `__init__.py` files separately.
Copy link
Copy Markdown
Collaborator

@FlorianDeconinck FlorianDeconinck left a comment

Choose a reason for hiding this comment

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

Nice.

@romanc romanc merged commit a664e74 into NOAA-GFDL:develop Jul 21, 2025
5 checks passed
@romanc romanc deleted the romanc/flake8-cleanup branch July 21, 2025 07:13
jjuyeonkim pushed a commit to jjuyeonkim/NDSL that referenced this pull request Sep 8, 2025
Update `__init__.py` files to use populate the `__all__` variable. That way, we don't need to handle `__init__.py` files separately.
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