![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Functions | |
| run_ctags () | |
| module_of (path) | |
| categorise (hdr, src) | |
| main () | |
Variables | |
| REPO = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
| SRC = os.path.join(REPO, "src") | |
| str | ORCHESTRATOR = "defined in darktable.c: the singleton-accessor pattern" |
| str | SUBDIR = "implementation lives in a subdirectory of the header" |
| str | PARENTDIR = "header lives in a subdirectory of the implementation" |
| str | UNRELATED = "unrelated directories" |
Find functions declared in one module's header but defined in another module's source.
The convention this checks is `example.h` declares, `example.c` defines. Where a definition
sits somewhere else, the definition is not where anyone looks for it and nothing warns --
`common/history_merge.c` carried two such cases in opposite directions, and neither surfaced
until an unrelated include had to be removed (roadmap section 13).
Parsing is Universal Ctags, not a regex: prototypes (kind `prototype`) are declarations,
`function` tags in a .c/.cc are definitions. Requires ctags on PATH; this is an audit that
produces a list to read, not a CI gate, so that dependency is fine.
Usage:
tools/decl_def_audit.py [--all] [--json]
By default only *cross-module* mismatches are reported -- a definition in a different
directory than its declaring header, which is where the real traps live. --all additionally
lists same-directory mismatches (declared in a.h, defined in b.c next door), which are often
deliberate.
| decl_def_audit.categorise | ( | hdr, | |
| src | |||
| ) |
Definition at line 74 of file decl_def_audit.py.
Referenced by main().
| decl_def_audit.main | ( | void | ) |
Definition at line 85 of file decl_def_audit.py.
References categorise(), main(), module_of(), and run_ctags().
Referenced by main().
| decl_def_audit.module_of | ( | path | ) |
The 'module' a file belongs to: its directory plus its basename without extension.
Definition at line 55 of file decl_def_audit.py.
Referenced by main().
| decl_def_audit.run_ctags | ( | ) |
Definition at line 32 of file decl_def_audit.py.
Referenced by main().
| str decl_def_audit.ORCHESTRATOR = "defined in darktable.c: the singleton-accessor pattern" |
Definition at line 68 of file decl_def_audit.py.
| str decl_def_audit.PARENTDIR = "header lives in a subdirectory of the implementation" |
Definition at line 70 of file decl_def_audit.py.
| decl_def_audit.REPO = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
Definition at line 28 of file decl_def_audit.py.
| decl_def_audit.SRC = os.path.join(REPO, "src") |
Definition at line 29 of file decl_def_audit.py.
| str decl_def_audit.SUBDIR = "implementation lives in a subdirectory of the header" |
Definition at line 69 of file decl_def_audit.py.
| str decl_def_audit.UNRELATED = "unrelated directories" |
Definition at line 71 of file decl_def_audit.py.