fix(lint): hoist hooks_cli_mod import to top of test_hooks_cli (E402)#1375
Merged
Conversation
The alias was placed below an explanatory comment block introduced by #1305, which trips ruff E402 (module-level import not at top of file). Moved next to the existing 'from mempalace.hooks_cli import (...)' line. CI lint went red on develop after #1305 merged with the failing check; this re-greens it so subsequent PRs do not inherit the failure.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a Ruff E402 lint failure in tests/test_hooks_cli.py by moving a module-level import (import mempalace.hooks_cli as hooks_cli_mod) to the top-of-file import section, keeping the existing explanatory comment block focused on test intent rather than import placement.
Changes:
- Hoist
import mempalace.hooks_cli as hooks_cli_modto the top oftests/test_hooks_cli.pyto satisfy Ruff’s “imports at top of file” rule. - Remove the now-redundant mid-file import that was triggering E402.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Problem
The lint check on develop has been failing since #1305 merged with a red `lint` check (the other 5 OS lanes were green, so the merge went through). The failure is:
```
tests/test_hooks_cli.py:972:1: E402 Module level import not at top of file
```
`import mempalace.hooks_cli as hooks_cli_mod` was placed at line 972, below an explanatory comment block introduced by #1305. Every PR rebased onto develop now inherits this failure (just hit it on #988's rebase).
Fix
Move the import next to the existing `from mempalace.hooks_cli import (...)` line at the top of the file. The comment block above the original location explains what the tests are checking, not why the import had to live there — there's no reason it can't sit with the other imports.
Test plan