Skip to content

Commit

Permalink
✅ chore : ruff test
Browse files Browse the repository at this point in the history
  • Loading branch information
Namgyu-Youn committed Jan 10, 2025
1 parent c16c2ff commit ecd73e5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
1 change: 0 additions & 1 deletion scripts/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"""GitHub topic generation package."""
from .analyzer import TopicAnalyzer
from .fetcher import GitHubFetcher
from .topic_list import TOPIC_LIST
Expand Down
8 changes: 2 additions & 6 deletions scripts/error_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ def handle_github_url_error(url: str, error_message: str) -> APIResponse:
APIResponse with error details
"""
error = GitHubURLError(
code="INVALID_GITHUB_URL", message=f"Invalid GitHub URL: {error_message}", context={"url": url}
)
error = GitHubURLError(code="INVALID_GITHUB_URL", message=f"Invalid GitHub URL: {error_message}", context={"url": url})
return APIResponse(success=False, errors=[error])

@staticmethod
Expand Down Expand Up @@ -112,9 +110,7 @@ def handle_file_fetch_error(file_path: str, error_message: str) -> APIResponse:
APIResponse with error details
"""
error = ErrorDetail(
code="FILE_FETCH_FAILED", message=f"Failed to fetch file: {error_message}", context={"file_path": file_path}
)
error = ErrorDetail(code="FILE_FETCH_FAILED", message=f"Failed to fetch file: {error_message}", context={"file_path": file_path})
return APIResponse(success=False, errors=[error])

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion scripts/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ async def fetch_readme(self, url: str) -> str:
response.raise_for_status()
return await response.text()
except Exception as e:
raise Exception(f"Failed to fetch README: {e!s}") from e
raise Exception(f"Failed to fetch README: {e!s}") from e
4 changes: 1 addition & 3 deletions scripts/github_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,7 @@ async def analyze_repository(self, repo_url: str, category: str, subcategory: st
# Analyze README content
readme_topics = []
if "README.md" in files_content:
readme_topics = await self.topic_analyzer.generate_topics(
files_content["README.md"], category, subcategory
)
readme_topics = await self.topic_analyzer.generate_topics(files_content["README.md"], category, subcategory)

# Get dependencies
dependencies = await self._analyze_dependencies(files_content)
Expand Down

0 comments on commit ecd73e5

Please sign in to comment.