diff --git a/src/cli/gentest/source_code_generator.py b/src/cli/gentest/source_code_generator.py index b6b0ae8cb90..8da2bef155a 100644 --- a/src/cli/gentest/source_code_generator.py +++ b/src/cli/gentest/source_code_generator.py @@ -67,17 +67,24 @@ def format_code(code: str) -> str: # Create a Path object for the input file input_file_path = Path(temp_file.name) - # Get the path to the black executable in the virtual environment + # Get the path to the formatter executable in the virtual environment if sys.platform.startswith("win"): - black_path = Path(sys.prefix) / "Scripts" / "black.exe" + formatter_path = Path(sys.prefix) / "Scripts" / "ruff.exe" else: - black_path = Path(sys.prefix) / "bin" / "black" + formatter_path = Path(sys.prefix) / "bin" / "ruff" - # Call black to format the file + # Call ruff to format the file config_path = Path(sys.prefix).parent / "pyproject.toml" subprocess.run( - [str(black_path), str(input_file_path), "--quiet", "--config", str(config_path)], + [ + str(formatter_path), + "format", + str(input_file_path), + "--quiet", + "--config", + str(config_path), + ], check=True, ) diff --git a/src/cli/gentest/templates/blockchain_test/transaction.py.j2 b/src/cli/gentest/templates/blockchain_test/transaction.py.j2 index f19836c41a4..ef192d37c07 100644 --- a/src/cli/gentest/templates/blockchain_test/transaction.py.j2 +++ b/src/cli/gentest/templates/blockchain_test/transaction.py.j2 @@ -1,7 +1,7 @@ """ Gentest autogenerated test from `tx.hash`: {{ tx_hash }} -https://etherscan.io/tx/{{tx_hash}} +https://etherscan.io/tx/{{tx_hash}}. """ from typing import Dict @@ -25,7 +25,7 @@ def test_transaction_{{ tx_hash }}( ): """ Gentest autogenerated test for tx.hash: - {{ tx_hash }} + {{ tx_hash }}. """ pre = {{ pre_state | stringify }}