Skip to content

Commit 64c977f

Browse files
authored
Revert "Count inline comments"
1 parent bdef661 commit 64c977f

6 files changed

Lines changed: 3 additions & 72 deletions

File tree

cli/commands/analyze.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ def analyze_command(file, all, json_output, LANG_FILE):
1717
"line_count",
1818
"function_count",
1919
"comment_line_count",
20-
"inline_comment_count",
2120
"indentation_level"
2221
]
2322

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

cli/translations/en.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@
99
"line_count": "The file has {count} lines",
1010
"function_count": "The file has {count} functions",
1111
"comment_line_count": "The file has {count} comment lines",
12-
"inline_comment_count": "The file has {count} inline comments",
1312
# keys for analyze command checkbox menu
1413
"select_stats": "Select stats to display:",
1514
"line_count_option": "Line Count",
1615
"function_count_option": "Function Count",
1716
"comment_line_count_option": "Comment Line Count",
18-
"inline_comment_count_option": "Inline Comment Count",
1917
"no_stats_selected": "No stats selected. Analysis cancelled.",
2018
"confirm_and_analyze": "Confirm and analyze",
2119
"checkbox_hint": "(Use space to select, enter to confirm)",

cli/translations/fremen.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
messages = {
22
# keys for the hello command
33
"welcome": "🌶️ Salam, wanderer, and welcome to the sietch of [bold red]SpiceCode[/]! 🌶️",
4-
"description": "🔥 The [yellow]Fedaykin CLI[/] that ignites your code with spice, as fierce as Arrakis' dunes 🥵",
4+
"description": "🔥 The [yellow]Fedaykin CLI[/] that ignites your code with spice, as fierce as Arrakis dunes 🥵",
55
# error messages
66
"error": "خطأ:",
77
# keys for the analyze command output
88
"analyzing_file": "Deciphering the file's sand-script",
99
"line_count": "The file spans {count} dunes",
1010
"function_count": "The file holds {count} sacred routines",
1111
"comment_line_count": "The file whispers {count} lines of hidden lore",
12-
"inline_comment_count": "The file contains {count} passages of dual meaning",
1312
# keys for analyze command checkbox menu
1413
"select_stats": "Choose the omens to unveil:",
1514
"line_count_option": "Dune Count",
1615
"function_count_option": "Sacred Routines",
1716
"comment_line_count_option": "Whispered Lore",
18-
"inline_comment_count_option": "Passages of Dual Meaning",
1917
"no_stats_selected": "No omens were heeded. The analysis fades into the sands.",
2018
"confirm_and_analyze": "Seal your fate and analyze",
2119
"checkbox_hint": "(Use space to mark, enter to proceed)"

cli/translations/pt-br.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@
99
"line_count": "O arquivo tem {count} linhas",
1010
"function_count": "O arquivo tem {count} funções",
1111
"comment_line_count": "O arquivo tem {count} linhas de comentário",
12-
"inline_comment_count": "O arquivo tem {count} comentários inline",
1312
# chaves para o menu de seleção do comando analyze
1413
"select_stats": "Selecione as estatísticas para exibir:",
1514
"line_count_option": "Contagem de Linhas",
1615
"function_count_option": "Contagem de Funções",
1716
"comment_line_count_option": "Contagem de Linhas de Comentário",
18-
"inline_comment_count_option": "Contagem de Comentários Inline",
1917
"no_stats_selected": "Nenhuma estatística selecionada. Análise cancelada.",
2018
"confirm_and_analyze": "Confirmar e analisar",
2119
"checkbox_hint": "(Use espaço para selecionar, enter para confirmar)"

spice/analyze.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ def analyze_file(file_path: str, selected_stats: Optional[List[str]] = None) ->
1010
Args:
1111
file_path (str): Path to the file to analyze
1212
selected_stats (list, optional): List of stats to compute. If None, compute all stats.
13-
Valid stats are: "line_count", "function_count", "comment_line_count",
14-
"inline_comment_count", "indentation_level"
13+
Valid stats are: "line_count", "function_count", "comment_line_count", "indentation_level"
1514
1615
Returns:
1716
dict: Dictionary containing the requested stats and file information
@@ -35,7 +34,7 @@ def analyze_file(file_path: str, selected_stats: Optional[List[str]] = None) ->
3534
raise ValueError("File has no extension")
3635

3736
# Define valid stats
38-
valid_stats = ["line_count", "function_count", "comment_line_count", "inline_comment_count", "indentation_level"]
37+
valid_stats = ["line_count", "function_count", "comment_line_count", "indentation_level"]
3938

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

75-
# inline comment count if requested
76-
if "inline_comment_count" in selected_stats:
77-
from spice.analyzers.count_inline_comments import count_inline_comments
78-
from utils.get_lexer import get_lexer_for_file
79-
LexerClass = get_lexer_for_file(file_path)
80-
lexer = LexerClass(source_code=code) # Pass source_code explicitly
81-
results["inline_comment_count"] = count_inline_comments(file_path)
82-
8374
# indentation analysis if requested
8475
if "indentation_level" in selected_stats:
8576
indentation_info = detect_indentation(code)

spice/analyzers/count_inline_comments.py

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)