Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnnyevans32 committed Nov 18, 2024
1 parent d8611f9 commit 9a32d3c
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/goose_plugins/toolkits/filetype_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ def analyze_file_types(
"""
try:
analyzer = FileTypeAnalyzer()
result = analyzer.analyze(
project_dir, include_subdirectories, exclude_paths
)
result = analyzer.analyze(project_dir, include_subdirectories, exclude_paths)

if output_file:
reporter = ReportGenerator()
Expand Down Expand Up @@ -76,10 +74,7 @@ def analyze(self, directory, recursive=True, exclude_paths=None):
file_counts = {}
total_files = 0

exclude_paths = [
os.path.abspath(os.path.join(directory, path))
for path in (exclude_paths or [])
]
exclude_paths = [os.path.abspath(os.path.join(directory, path)) for path in (exclude_paths or [])]

for root, _, files in os.walk(directory):
# Skip excluded directories and their subdirectories
Expand All @@ -102,9 +97,7 @@ def analyze(self, directory, recursive=True, exclude_paths=None):
break

# Calculate percentages
percentages = {
ext: (count / total_files) * 100 for ext, count in file_counts.items()
}
percentages = {ext: (count / total_files) * 100 for ext, count in file_counts.items()}

return {
"file_counts": file_counts,
Expand Down

0 comments on commit 9a32d3c

Please sign in to comment.