Skip to content

Commit

Permalink
Do not generate class if description in explain in <empty> (#2007)
Browse files Browse the repository at this point in the history
  • Loading branch information
myakove authored Aug 7, 2024
1 parent f69b1b3 commit 3c04f85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ repos:
hooks:
- id: mypy
exclude: ^(tests/|examples/|docs/)
additional_dependencies: [types-all]
additional_dependencies: ["types-PyYAML"]
4 changes: 4 additions & 0 deletions class_generator/class_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,10 @@ def parse_explain(

resource_dict["KIND"] = raw_resource_dict["KIND"].strip()
resource_dict["DESCRIPTION"] = raw_resource_dict["DESCRIPTION"].strip()
if resource_dict["DESCRIPTION"] == "<empty>":
LOGGER.error("Empty description for resource, exiting")
sys.exit(1)

resource_dict["GROUP"] = raw_resource_dict.get("GROUP", "").strip()
resource_dict["VERSION"] = raw_resource_dict.get("VERSION", "").strip()

Expand Down

0 comments on commit 3c04f85

Please sign in to comment.