Skip to content

Commit 979e10a

Browse files
sidcarton1587claude
andcommitted
Fix f-string syntax error in generate_docs.py
Fixed E999 SyntaxError where f-string expression contained a backslash. Moved the replace operation outside the f-string expression to comply with Python syntax rules. Before: f"`{command_name_raw.replace('|', '\\|')}`" After: Split into two lines with variable assignment first This fixes the flake8 lint error in GitHub Actions CI/CD. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent aebfb10 commit 979e10a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

generate_docs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ def generate_markdown_table(yaml_file_path, output_md_path):
5959
# --- UPDATED: Iterate over the newly sorted list ---
6060
for command in sorted_commands:
6161
command_name_raw = command.get('name', 'N/A')
62-
command_name_md = f"`{command_name_raw.replace('|', '\\|')}`"
62+
# Escape pipe characters (can't use backslash in f-string expression)
63+
command_name_escaped = command_name_raw.replace('|', '\\|')
64+
command_name_md = f"`{command_name_escaped}`"
6365
command_desc = command.get('help', '').replace('|', '\\|').replace('\n', ' ')
6466

6567
arguments_details = _generate_args_html_details(command.get('arguments'), command_name_raw)

0 commit comments

Comments
 (0)