Page MenuHomePhabricator

Add circular dependencies script
ClosedPublic

Authored by Fabien on Jul 23 2019, 14:59.

Details

Summary
This script finds dependencies between source code modules, treating the
.cpp and .h file as one unit (so it will detect A.cpp depending on B.h
where B.cpp depends on A.h). This can be used to find out which modules
cannot be used independently from each other.

It is very simplistic at this point, and assumes that a .cpp file's
corresponding header has the exact same name, with .cpp replaced by .h.
Furthermore, it assumes all #includes are relative to the src/
directory.

Backport of core PR13228
https://github.com/bitcoin/bitcoin/pull/13228/files

Test Plan
cd src
../contrib/devtools/circular-dependencies.py {*,*/*,*/*/*}.{h,cpp}

Diff Detail

Repository
rABC Bitcoin ABC
Branch
PR13228
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 6920
Build 11887: Bitcoin ABC Buildbot (legacy)
Build 11886: arc lint + arc unit

Event Timeline

deadalnix requested changes to this revision.Jul 23 2019, 17:31
deadalnix added inline comments.
contrib/devtools/README.md
129

two dots

This revision now requires changes to proceed.Jul 23 2019, 17:31
contrib/devtools/README.md
129

I think the meaning here is <wherever your project root is>/src, as there is no reason to suppose the user is anywhere in the tree when reading the doc.
I'll change it to be more explicit.

This revision is now accepted and ready to land.Jul 24 2019, 13:15
This revision was automatically updated to reflect the committed changes.