Fix all flake8 violations across the codebase
CODE STYLE FIXES: - Fixed line length violations by breaking long lines appropriately - Removed unused imports (os from installer.py and registry.py) - Removed unused variables (package_name in _create_pyproject_toml) - Fixed f-string usage (removed f-strings without placeholders) - Fixed import organization and removed redundant imports - Added missing newlines at end of files SPECIFIC FIXES: - cli.py: Split long option line, fixed f-string usage, added newline - installer.py: Removed unused imports/variables, fixed line breaks, improved validation logic - registry.py: Removed unused import/variable, broke long condition line - test files: Removed unused imports, fixed long assertion lines, added newlines All 24 tests still pass and flake8 now reports no violations. Code is now compliant with PEP 8 style guidelines. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"""Tests for agent installer functionality."""
|
||||
|
||||
import pytest
|
||||
import json
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
from kaizen_agentic.installer import AgentInstaller, ProjectInitializer, InstallationConfig
|
||||
from kaizen_agentic.registry import AgentRegistry
|
||||
@@ -192,7 +192,7 @@ def test_project_initializer(test_registry, tmp_path):
|
||||
initializer = ProjectInitializer(test_registry)
|
||||
project_dir = tmp_path / "new_project"
|
||||
|
||||
results = initializer.init_project(
|
||||
initializer.init_project(
|
||||
project_dir,
|
||||
template="python-basic",
|
||||
project_name="new_project"
|
||||
@@ -217,7 +217,7 @@ def test_project_initializer_custom_agents(test_registry, tmp_path):
|
||||
initializer = ProjectInitializer(test_registry)
|
||||
project_dir = tmp_path / "custom_project"
|
||||
|
||||
results = initializer.init_project(
|
||||
initializer.init_project(
|
||||
project_dir,
|
||||
template="python-basic",
|
||||
agent_names=["base-agent", "todo-keeper"],
|
||||
@@ -243,4 +243,4 @@ def test_installation_config():
|
||||
assert config.claude_config_path == Path("/tmp/test/claude.json")
|
||||
assert config.makefile_path == Path("/tmp/test/Makefile")
|
||||
assert config.update_docs is True
|
||||
assert config.create_backup is False
|
||||
assert config.create_backup is False
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
"""Tests for agent registry functionality."""
|
||||
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
from kaizen_agentic.registry import AgentRegistry, AgentDefinition, AgentCategory
|
||||
|
||||
|
||||
@@ -215,21 +213,36 @@ dependencies: ["non-existent-agent"]
|
||||
def test_agent_category_determination():
|
||||
"""Test automatic category determination."""
|
||||
# Test project management category
|
||||
assert AgentDefinition._determine_category("todo-keeper", "") == AgentCategory.PROJECT_MANAGEMENT
|
||||
assert AgentDefinition._determine_category("changelog-helper", "") == AgentCategory.PROJECT_MANAGEMENT
|
||||
result = AgentDefinition._determine_category("todo-keeper", "")
|
||||
assert result == AgentCategory.PROJECT_MANAGEMENT
|
||||
|
||||
result = AgentDefinition._determine_category("changelog-helper", "")
|
||||
assert result == AgentCategory.PROJECT_MANAGEMENT
|
||||
|
||||
# Test testing category
|
||||
assert AgentDefinition._determine_category("test-runner", "") == AgentCategory.TESTING
|
||||
assert AgentDefinition._determine_category("tdd-workflow", "") == AgentCategory.TESTING
|
||||
result = AgentDefinition._determine_category("test-runner", "")
|
||||
assert result == AgentCategory.TESTING
|
||||
|
||||
result = AgentDefinition._determine_category("tdd-workflow", "")
|
||||
assert result == AgentCategory.TESTING
|
||||
|
||||
# Test code quality category
|
||||
assert AgentDefinition._determine_category("code-refactoring", "") == AgentCategory.CODE_QUALITY
|
||||
assert AgentDefinition._determine_category("optimization-helper", "") == AgentCategory.CODE_QUALITY
|
||||
result = AgentDefinition._determine_category("code-refactoring", "")
|
||||
assert result == AgentCategory.CODE_QUALITY
|
||||
|
||||
result = AgentDefinition._determine_category("optimization-helper", "")
|
||||
assert result == AgentCategory.CODE_QUALITY
|
||||
|
||||
# Test documentation category
|
||||
assert AgentDefinition._determine_category("documentation-generator", "") == AgentCategory.DOCUMENTATION
|
||||
assert AgentDefinition._determine_category("claude-helper", "") == AgentCategory.DOCUMENTATION
|
||||
result = AgentDefinition._determine_category("documentation-generator", "")
|
||||
assert result == AgentCategory.DOCUMENTATION
|
||||
|
||||
result = AgentDefinition._determine_category("claude-helper", "")
|
||||
assert result == AgentCategory.DOCUMENTATION
|
||||
|
||||
# Test infrastructure category
|
||||
assert AgentDefinition._determine_category("setup-repository", "") == AgentCategory.INFRASTRUCTURE
|
||||
assert AgentDefinition._determine_category("tooling-manager", "") == AgentCategory.INFRASTRUCTURE
|
||||
result = AgentDefinition._determine_category("setup-repository", "")
|
||||
assert result == AgentCategory.INFRASTRUCTURE
|
||||
|
||||
result = AgentDefinition._determine_category("tooling-manager", "")
|
||||
assert result == AgentCategory.INFRASTRUCTURE
|
||||
|
||||
Reference in New Issue
Block a user