Skip to content

chore(tests): fix ruff lint violations in tests/#2827

Merged
mnriem merged 1 commit into
github:mainfrom
darion-yaphet:chore/fix-tests-ruff
Jun 3, 2026
Merged

chore(tests): fix ruff lint violations in tests/#2827
mnriem merged 1 commit into
github:mainfrom
darion-yaphet:chore/fix-tests-ruff

Conversation

@darion-yaphet
Copy link
Copy Markdown
Contributor

Summary

Repo-wide ruff check (no path arg) reported 51 violations, all in tests/. The lint config only scopes src/, so the tests/ tree had drifted over time. This clears that pre-existing debt. No behavior change — purely lint hygiene.

Independent of the PR-N __init__.py split series; branched off main.

Changes

Rule Count Fix
F401 14 Remove unused imports (autofix)
E702 14 Split semicolon-joined statements onto separate lines
F841 15 Drop unused bindings, keep the side-effecting calls (_minimal_feature, install_from_directory)
F541 4 Remove redundant f prefix on f-strings without placeholders
E741 4 Rename ambiguous lln in comprehensions

For 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
  • Full suite: 3344 passed, 40 skipped

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.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 ruff compliance.
  • Rename ambiguous loop/comprehension variable names (e.g., lln) 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 lln 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 lln in a list comprehension for lint compliance.
tests/extensions/git/test_git_extension.py Renames lln 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 mnriem merged commit 67fecd3 into github:main Jun 3, 2026
11 checks passed
@mnriem
Copy link
Copy Markdown
Collaborator

mnriem commented Jun 3, 2026

Thank you!

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.

3 participants