Skip to content
Merged
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
6 changes: 3 additions & 3 deletions codeflash/cli_cmds/cmd_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def init_codeflash() -> None:

install_github_app()

install_github_actions()
install_github_actions(override_formatter_check=True)

click.echo(
f"{LF}"
Expand Down Expand Up @@ -362,9 +362,9 @@ def check_for_toml_or_setup_file() -> str | None:
return cast(str, project_name)


def install_github_actions() -> None:
def install_github_actions(override_formatter_check: bool=False) -> None:
try:
config, config_file_path = parse_config_file()
config, config_file_path = parse_config_file(override_formatter_check=override_formatter_check)

ph("cli-github-actions-install-started")
try:
Expand Down
12 changes: 7 additions & 5 deletions codeflash/code_utils/config_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def find_pyproject_toml(config_file: Path | None = None) -> Path:
raise ValueError(msg)


def parse_config_file(config_file_path: Path | None = None) -> tuple[dict[str, Any], Path]:
def parse_config_file(config_file_path: Path | None = None, override_formatter_check: bool=False) -> tuple[dict[str, Any], Path]:
config_file_path = find_pyproject_toml(config_file_path)
try:
with config_file_path.open("rb") as f:
Expand Down Expand Up @@ -85,10 +85,12 @@ def parse_config_file(config_file_path: Path | None = None) -> tuple[dict[str, A
"In pyproject.toml, Codeflash only supports the 'test-framework' as pytest and unittest."
)
if len(config["formatter-cmds"]) > 0:
assert config["formatter-cmds"][0] != "your-formatter $file", (
"The formatter command is not set correctly in pyproject.toml. Please set the "
"formatter command in the 'formatter-cmds' key. More info - https://docs.codeflash.ai/configuration"
)
#see if this is happening during Github actions setup
if not override_formatter_check:
assert config["formatter-cmds"][0] != "your-formatter $file", (
"The formatter command is not set correctly in pyproject.toml. Please set the "
"formatter command in the 'formatter-cmds' key. More info - https://docs.codeflash.ai/configuration"
)
for key in list(config.keys()):
if "-" in key:
config[key.replace("-", "_")] = config[key]
Expand Down
Loading