chore(tests): fix ruff lint violations in tests/#2827
Merged
Conversation
Clear pre-existing lint debt flagged by repo-wide `ruff check` (the lint config only scopes src/, so tests/ had drifted). No behavior change. - F401/F541: drop unused imports and redundant f-string prefixes (autofix) - E741: rename ambiguous `l` to `ln` in comprehensions - E702: split semicolon-joined statements onto separate lines - F841: drop unused bindings while keeping the side-effecting calls (_minimal_feature, install_from_directory) Full suite: 3344 passed, 40 skipped. ruff check (repo-wide): clean.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR clears pre-existing ruff check violations in the tests/ tree by applying mechanical lint fixes (unused imports/bindings, semicolon splits, redundant f-strings, and ambiguous variable renames) without changing runtime behavior of the product code.
Changes:
- Remove unused imports and unused assignment targets while preserving side-effecting calls in tests.
- Replace redundant f-strings and split semicolon-joined statements for
ruffcompliance. - Rename ambiguous loop/comprehension variable names (e.g.,
l→ln) to satisfy lint rules.
Show a summary per file
| File | Description |
|---|---|
| tests/test_version_imports.py | Drops an unused import from specify_cli._version to satisfy F401. |
| tests/test_utils_assets_imports.py | Removes unused specify_cli re-exports from the import guard test. |
| tests/test_timestamp_branches.py | Replaces a redundant f-string with a plain string in a subprocess invocation. |
| tests/test_setup_tasks.py | Removes unused feat = ... bindings while keeping the fixture-setup calls. |
| tests/test_extension_skills.py | Removes unused ExtensionError import and unused manifest = ... bindings while preserving install calls. |
| tests/test_console_imports.py | Removes unused direct imports while keeping the star-import regression assertions. |
| tests/test_commands_package.py | Removes unused re-exports from an import assertion to satisfy F401. |
| tests/test_authentication.py | Splits semicolon-joined statements and removes an unused import for lint compliance. |
| tests/integrations/test_integration_subcommand.py | Removes an unused top-level pytest import (file uses a local import where needed). |
| tests/integrations/test_integration_base_yaml.py | Renames l → ln in comprehensions to avoid ambiguous variable linting. |
| tests/integrations/test_integration_base_markdown.py | Replaces redundant f-strings with plain strings in expected file lists. |
| tests/integrations/test_integration_agy.py | Renames l → ln in a list comprehension for lint compliance. |
| tests/extensions/git/test_git_extension.py | Renames l → ln in a list comprehension extracting JSON lines. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 13/13 changed files
- Comments generated: 0
mnriem
approved these changes
Jun 3, 2026
Collaborator
|
Thank you! |
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.
Summary
Repo-wide
ruff check(no path arg) reported 51 violations, all intests/. The lint config only scopessrc/, so thetests/tree had drifted over time. This clears that pre-existing debt. No behavior change — purely lint hygiene.Independent of the PR-N
__init__.pysplit series; branched offmain.Changes
_minimal_feature,install_from_directory)fprefix on f-strings without placeholdersl→lnin comprehensionsFor F841 the variable was dropped but the call preserved, since those calls set up fixtures / install on disk.
Test plan
uv tool run ruff check(repo-wide) — All checks passed