Repository navigation
Restore opt-in COP001 without runtime import lookup - #7
Merged
Merged
Conversation
vrslev
marked this pull request as ready for review
October 12, 2026 11:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
COP001 was disabled because module detection depended on how flake8 was invoked. Restore it using source and filesystem inspection, with project roots derived from the linted filename so console-script and
python -m flake8invocations agree.Keep the existing COP extension. COP001 stays off when selecting the broad COP prefix; repositories opt in using
extend-select = ["COP001"]or by selecting the exact COP001 code. Existing rules remain active without that opt-in.The checker does not execute inspected packages, import hooks, native modules, or
.pthfiles. It reports imports of more than two statically identifiable symbols, preserves the standard-library and existing import exemptions, and leaves unresolved imports and dynamic exports unchecked. Update the plugin's own three-symbol import to satisfy the restored rule.Validation: 221 tests pass locally, including CLI and TOML opt-in, default compatibility, flat/src/namespace layouts, installed source and stub packages, both CLI entry points, and regressions for package initialization side effects and runtime import lookup. Ruff, flake8, mypy, and auto-typing-final pass on Python 3.13; the CI matrix covers Linux, macOS, and Windows on Python 3.10–3.14.