HomePhabricator

Add circular dependencies script

Description

Add circular dependencies script

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}

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D3717

Details

Provenance
Pieter Wuille <pieter.wuille@gmail.com>Authored on May 2 2018, 18:12
FabienCommitted on Jul 24 2019, 14:22
FabienPushed on Jul 24 2019, 14:22
Reviewer
Restricted Project
Differential Revision
D3717: Add circular dependencies script
Parents
rABCa5ef42413fb8: Use a struct for arguments and nested map for categories
Branches
Unknown
Tags
Unknown