Use one-line module docstrings in the API checker scripts

Codacy runs two docstring checkers with opposite rules for module
docstrings: with the summary on the first line it reported D213, with
the summary on the second line it reports D212. A one-line docstring
satisfies both. Keep the summary as the docstring and move the details
into a comment below it; nothing reads the module docstrings.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann
2026-09-28 18:42:34 +02:00
parent da5097abcd
commit 4c73319d3b
5 changed files with 57 additions and 67 deletions
+9 -11
View File
@@ -1,16 +1,14 @@
#!/usr/bin/env python3
"""
Advisory-only cross-check between documented macros and their #define sites.
"""Advisory-only cross-check between documented macros and their #define sites."""
Macros have no C++ access-specifier concept, so the AST-based public/private test that
extract_api.py uses for classes doesn't transfer -- see tools/api_checker/POLICY.md's "Known
limitations" section. This script only checks one direction: that every macro documented under
docs/mkdocs/docs/api/macros/ still has a matching #define somewhere under include/nlohmann/,
catching stale or renamed doc pages. It does NOT check the converse (undocumented macros) --
no reliable signal exists for that direction given this codebase's conventions.
Never blocks CI -- always exits 0, even when it reports findings.
"""
# Macros have no C++ access-specifier concept, so the AST-based public/private test that
# extract_api.py uses for classes doesn't transfer -- see tools/api_checker/POLICY.md's "Known
# limitations" section. This script only checks one direction: that every macro documented under
# docs/mkdocs/docs/api/macros/ still has a matching #define somewhere under include/nlohmann/,
# catching stale or renamed doc pages. It does NOT check the converse (undocumented macros) --
# no reliable signal exists for that direction given this codebase's conventions.
#
# Never blocks CI -- always exits 0, even when it reports findings.
import argparse
import glob