Skip to content

Add required=True to --cfg-path Click option in MLIR static_binding_generator CLI #358

Description

@coderabbitai

Summary

The --cfg-path Click option in numbast/src/numbast/experimental/mlir/tools/static_binding_generator.py is declared without required=True, but cfg_path is used unconditionally inside the command handler via Config.from_yaml_path(cfg_path), which opens the file without checking for None. When --cfg-path is omitted, Click passes None to this function, causing a TypeError at runtime.

The --output-dir option in the same command already uses required=True as a precedent.

Suggested fix

@click.option(
    "--cfg-path",
    type=click.Path(exists=True, dir_okay=False, readable=True),
    required=True,
)

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions