Skip to content

Commit 2843f83

Browse files
committed
fix: resolve ruff lint errors to pass CI
- Fix undefined 'repo' variable in align.py (use assessment.repository) - Add noqa comments for intentional jsonschema import checks - Fix unused variable warnings in test files All linters now pass: black, isort, and ruff.
1 parent 7e507dc commit 2843f83

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

src/agentready/cli/align.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ def align(repository, dry_run, attributes, interactive):
118118
attribute_list = [a.strip() for a in attributes.split(",")]
119119

120120
fixer_service = FixerService()
121-
fix_plan = fixer_service.generate_fix_plan(assessment, repo, attribute_list)
121+
fix_plan = fixer_service.generate_fix_plan(
122+
assessment, assessment.repository, attribute_list
123+
)
122124

123125
if not fix_plan.fixes:
124126
click.echo("\n✅ No automatic fixes available.")

src/agentready/services/schema_validator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from typing import Any
66

77
try:
8-
import jsonschema
8+
import jsonschema # noqa: F401
99
from jsonschema import Draft7Validator, validators
1010

1111
JSONSCHEMA_AVAILABLE = True

tests/integration/test_schema_commands.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def sample_report(tmp_path):
7272
def test_validate_report_valid(runner, sample_report):
7373
"""Test validate-report command with valid report."""
7474
try:
75-
import jsonschema
75+
import jsonschema # noqa: F401
7676
except ImportError:
7777
pytest.skip("jsonschema not installed")
7878

@@ -85,7 +85,7 @@ def test_validate_report_valid(runner, sample_report):
8585
def test_validate_report_nonexistent(runner, tmp_path):
8686
"""Test validate-report command with nonexistent file."""
8787
try:
88-
import jsonschema
88+
import jsonschema # noqa: F401
8989
except ImportError:
9090
pytest.skip("jsonschema not installed")
9191

@@ -100,7 +100,7 @@ def test_validate_report_nonexistent(runner, tmp_path):
100100
def test_validate_report_invalid_json(runner, tmp_path):
101101
"""Test validate-report command with invalid JSON."""
102102
try:
103-
import jsonschema
103+
import jsonschema # noqa: F401
104104
except ImportError:
105105
pytest.skip("jsonschema not installed")
106106

@@ -117,7 +117,7 @@ def test_validate_report_invalid_json(runner, tmp_path):
117117
def test_validate_report_no_strict(runner, sample_report):
118118
"""Test validate-report with --no-strict option."""
119119
try:
120-
import jsonschema
120+
import jsonschema # noqa: F401
121121
except ImportError:
122122
pytest.skip("jsonschema not installed")
123123

@@ -174,7 +174,7 @@ def test_migrate_report_unsupported_version(runner, sample_report):
174174
def test_validate_then_migrate_workflow(runner, sample_report, tmp_path):
175175
"""Test full workflow: validate, migrate, validate again."""
176176
try:
177-
import jsonschema
177+
import jsonschema # noqa: F401
178178
except ImportError:
179179
pytest.skip("jsonschema not installed")
180180

tests/unit/learners/test_llm_enricher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ def test_call_claude_api_builds_prompt(
415415
"""Test that _call_claude_api builds correct prompt."""
416416
enricher = LLMEnricher(mock_anthropic_client, cache_dir=tmp_path)
417417

418-
result = enricher._call_claude_api(
418+
enricher._call_claude_api(
419419
basic_skill, sample_finding, sample_repository, "code samples"
420420
)
421421

tests/unit/test_assessment_cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test_cache_directory_creation(self):
2020
"""Test that cache directory is created if it doesn't exist."""
2121
with TemporaryDirectory() as tmpdir:
2222
cache_dir = Path(tmpdir) / "deep" / "nested" / "cache"
23-
cache = AssessmentCache(cache_dir)
23+
AssessmentCache(cache_dir)
2424
assert cache_dir.exists()
2525

2626
def test_get_cache_stats_empty(self):

tests/unit/test_security_controls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def test_sql_injection_in_repo_url(self):
105105
commit_hash = "abc123"
106106

107107
# Should not crash or execute SQL
108-
count = cache.invalidate(malicious_url, commit_hash)
108+
cache.invalidate(malicious_url, commit_hash)
109109

110110
# Verify table still exists by querying
111111
stats = cache.get_stats()

0 commit comments

Comments
 (0)