Skip to content

Commit dae0d5f

Browse files
committed
refactor: improve readability of conditional block
1 parent 9ce0975 commit dae0d5f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

scripts/validate_skills.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,7 @@ def flag(file: Path, msg: str) -> None:
9898
f'parent directory "{skill_dir.name}"',
9999
)
100100

101-
if not isinstance(description, str) or not description.strip():
102-
flag(file, "description is missing or not a non-empty string")
103-
else:
101+
if isinstance(description, str) and description.strip():
104102
if len(description) > DESC_MAX:
105103
flag(
106104
file,
@@ -113,6 +111,8 @@ def flag(file: Path, msg: str) -> None:
113111
"(`description: >-` on its own line, with content "
114112
"indented on the next line)",
115113
)
114+
else:
115+
flag(file, "description is missing or not a non-empty string")
116116

117117
if problems:
118118
for p in problems:

0 commit comments

Comments
 (0)