Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions cli/commands/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def analyze_command(file, all, json_output, LANG_FILE):
"line_count",
"function_count",
"comment_line_count",
"inline_comment_count",
"indentation_level"
]

Expand All @@ -26,7 +25,6 @@ def analyze_command(file, all, json_output, LANG_FILE):
"line_count": messages.get("line_count_option", "Line Count"),
"function_count": messages.get("function_count_option", "Function Count"),
"comment_line_count": messages.get("comment_line_count_option", "Comment Line Count"),
"inline_comment_count": messages.get("inline_comment_count_option", "Inline Comment Count"),
"indentation_level": messages.get("indentation_level_option", "Indentation Analysis")
}

Expand Down
2 changes: 0 additions & 2 deletions cli/translations/en.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
"line_count": "The file has {count} lines",
"function_count": "The file has {count} functions",
"comment_line_count": "The file has {count} comment lines",
"inline_comment_count": "The file has {count} inline comments",
# keys for analyze command checkbox menu
"select_stats": "Select stats to display:",
"line_count_option": "Line Count",
"function_count_option": "Function Count",
"comment_line_count_option": "Comment Line Count",
"inline_comment_count_option": "Inline Comment Count",
"no_stats_selected": "No stats selected. Analysis cancelled.",
"confirm_and_analyze": "Confirm and analyze",
"checkbox_hint": "(Use space to select, enter to confirm)",
Expand Down
4 changes: 1 addition & 3 deletions cli/translations/fremen.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
messages = {
# keys for the hello command
"welcome": "🌶️ Salam, wanderer, and welcome to the sietch of [bold red]SpiceCode[/]! 🌶️",
"description": "🔥 The [yellow]Fedaykin CLI[/] that ignites your code with spice, as fierce as Arrakis' dunes 🥵",
"description": "🔥 The [yellow]Fedaykin CLI[/] that ignites your code with spice, as fierce as Arrakis dunes 🥵",
# error messages
"error": "خطأ:",
# keys for the analyze command output
"analyzing_file": "Deciphering the file's sand-script",
"line_count": "The file spans {count} dunes",
"function_count": "The file holds {count} sacred routines",
"comment_line_count": "The file whispers {count} lines of hidden lore",
"inline_comment_count": "The file contains {count} passages of dual meaning",
# keys for analyze command checkbox menu
"select_stats": "Choose the omens to unveil:",
"line_count_option": "Dune Count",
"function_count_option": "Sacred Routines",
"comment_line_count_option": "Whispered Lore",
"inline_comment_count_option": "Passages of Dual Meaning",
"no_stats_selected": "No omens were heeded. The analysis fades into the sands.",
"confirm_and_analyze": "Seal your fate and analyze",
"checkbox_hint": "(Use space to mark, enter to proceed)"
Expand Down
2 changes: 0 additions & 2 deletions cli/translations/pt-br.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
"line_count": "O arquivo tem {count} linhas",
"function_count": "O arquivo tem {count} funções",
"comment_line_count": "O arquivo tem {count} linhas de comentário",
"inline_comment_count": "O arquivo tem {count} comentários inline",
# chaves para o menu de seleção do comando analyze
"select_stats": "Selecione as estatísticas para exibir:",
"line_count_option": "Contagem de Linhas",
"function_count_option": "Contagem de Funções",
"comment_line_count_option": "Contagem de Linhas de Comentário",
"inline_comment_count_option": "Contagem de Comentários Inline",
"no_stats_selected": "Nenhuma estatística selecionada. Análise cancelada.",
"confirm_and_analyze": "Confirmar e analisar",
"checkbox_hint": "(Use espaço para selecionar, enter para confirmar)"
Expand Down
13 changes: 2 additions & 11 deletions spice/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ def analyze_file(file_path: str, selected_stats: Optional[List[str]] = None) ->
Args:
file_path (str): Path to the file to analyze
selected_stats (list, optional): List of stats to compute. If None, compute all stats.
Valid stats are: "line_count", "function_count", "comment_line_count",
"inline_comment_count", "indentation_level"
Valid stats are: "line_count", "function_count", "comment_line_count", "indentation_level"

Returns:
dict: Dictionary containing the requested stats and file information
Expand All @@ -35,7 +34,7 @@ def analyze_file(file_path: str, selected_stats: Optional[List[str]] = None) ->
raise ValueError("File has no extension")

# Define valid stats
valid_stats = ["line_count", "function_count", "comment_line_count", "inline_comment_count", "indentation_level"]
valid_stats = ["line_count", "function_count", "comment_line_count", "indentation_level"]

# default to all stats if none specified
if selected_stats is None:
Expand Down Expand Up @@ -72,14 +71,6 @@ def analyze_file(file_path: str, selected_stats: Optional[List[str]] = None) ->
lexer = LexerClass(source_code=code) # Pass source_code explicitly
results["comment_line_count"] = count_comment_lines(file_path)

# inline comment count if requested
if "inline_comment_count" in selected_stats:
from spice.analyzers.count_inline_comments import count_inline_comments
from utils.get_lexer import get_lexer_for_file
LexerClass = get_lexer_for_file(file_path)
lexer = LexerClass(source_code=code) # Pass source_code explicitly
results["inline_comment_count"] = count_inline_comments(file_path)

# indentation analysis if requested
if "indentation_level" in selected_stats:
indentation_info = detect_indentation(code)
Expand Down
52 changes: 0 additions & 52 deletions spice/analyzers/count_inline_comments.py

This file was deleted.