Skip to content

Commit 2638639

Browse files
committed
Improve validate_description_files output
1 parent f0dd82b commit 2638639

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

generate_docs.py

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -851,12 +851,30 @@ def validate_description_files():
851851
print('To update, run:')
852852
print()
853853

854-
for p in sorted(descriptions_ids - docs_ids):
855-
size = Path('descriptions', p + '.md').stat().st_size
856-
print(f'rm descriptions/{p}.md # size={size}')
854+
non_empty = set()
855+
empty = set()
857856

858-
for p in sorted(docs_ids - descriptions_ids):
859-
print(f'touch descriptions/{p}.md')
857+
for p in descriptions_ids - docs_ids:
858+
size = Path('descriptions', p + '.md').stat().st_size
859+
if size > 0:
860+
non_empty.add(p)
861+
else:
862+
empty.add(p)
863+
864+
if non_empty:
865+
print('# Non-empty description files (!!!):')
866+
for p in sorted(non_empty):
867+
print(f'rm descriptions/{p}.md')
868+
869+
if empty:
870+
print('# Empty description files:')
871+
for p in sorted(empty):
872+
print(f'rm descriptions/{p}.md')
873+
874+
if docs_ids - descriptions_ids:
875+
print('# Missing description files:')
876+
for p in sorted(docs_ids - descriptions_ids):
877+
print(f'touch descriptions/{p}.md')
860878

861879

862880
def main():

0 commit comments

Comments
 (0)