Skip to content

Commit

Permalink
Add E702 to validation
Browse files Browse the repository at this point in the history
  • Loading branch information
yoland68 committed Jan 3, 2025
1 parent 8a1a11d commit 8e282c0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions comfy_cli/command/custom_nodes/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,13 +706,17 @@ def validate_node_for_publishing():
typer.echo("Running security checks...")
try:
# Run ruff check with security rules and --exit-zero to only warn
cmd = ["ruff", "check", ".", "-q", "--select", "S102,S307", "--exit-zero"]
cmd = ["ruff", "check", ".", "-q", "--select", "S102,S307,E702", "--exit-zero"]
result = subprocess.run(cmd, capture_output=True, text=True)

if result.stdout:
print("[yellow]Security warnings found:[/yellow]")
print(result.stdout)
print("[bold yellow]We will soon disable exec and eval, so this will be an error soon.[/bold yellow]")
print(
"[bold yellow]We will soon disable exec and eval, and multiple statements in a single line, so this will be an error soon.[/bold yellow]"
)
else:
print("[green]✓ All validation checks passed successfully[/green]")

except FileNotFoundError:
print("[red]Ruff is not installed. Please install it with 'pip install ruff'[/red]")
Expand All @@ -731,7 +735,7 @@ def validate():
Run validation checks that would be performed during publishing.
"""
validate_node_for_publishing()
print("[green]✓ All validation checks passed successfully[/green]")
# print("[green]✓ All validation checks passed successfully[/green]")


@app.command("publish", help="Publish node to registry")
Expand Down

0 comments on commit 8e282c0

Please sign in to comment.