Bug 130629 - Would like the style bot to prohibit #include layering violations
Summary: Would like the style bot to prohibit #include layering violations
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
: 252858 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-03-21 18:58 PDT by Geoffrey Garen
Modified: 2023-02-28 12:58 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Geoffrey Garen 2014-03-21 18:58:02 PDT
Some #includes are obvious layering violations.

For example, no file in WebCore/platform should ever #include any WebCore file outside WebCore/platform.

It would be nice to codify this in a simple script.

See, for a motivating example, https://bugs.webkit.org/show_bug.cgi?id=130275.
Comment 1 Geoffrey Garen 2014-03-21 18:58:18 PDT
<rdar://problem/16393051>
Comment 2 Zan Dobersek 2014-03-23 13:20:07 PDT
Should we start generating separate forwarding headers for the platform layer?

Cross-inclusion of <Platform/Header.h> in WebCore would be allowed at first, but it would extremely simplify locating these layering violations.
Comment 3 Zan Dobersek 2014-03-23 13:39:57 PDT
(In reply to comment #2)
> Cross-inclusion of <Platform/Header.h> in WebCore would be allowed at first, but it would extremely simplify locating these layering violations.

I meant the other way around, that is including <WebCore/Header.h> in the platform layer.
Comment 4 Csaba Osztrogonác 2014-03-25 05:09:18 PDT
In my opinion if we could get rid include paths (as blink did it),
it's obvious to catch layering violations by anybody without any
sophisticated script and style checker. But unfortunately there were
many objections against relative includes to Source.
Comment 5 Alexey Proskuryakov 2023-02-28 12:58:57 PST
*** Bug 252858 has been marked as a duplicate of this bug. ***