Skip to content

Commit b3313ee

Browse files
committed
feat: beginning of reusable project configs
1 parent 00035da commit b3313ee

File tree

7 files changed

+589
-89
lines changed

7 files changed

+589
-89
lines changed

config.schema.json

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Include Cleanup Configuration",
4+
"description": "Configuration settings for use with include cleanup scripts",
5+
"type": "object",
6+
"properties": {
7+
"dependencies": {
8+
"description": "Configuration settings for dependencies",
9+
"type": "object",
10+
"patternProperties": {
11+
".*": {
12+
"description": "Path to dependency in the source tree",
13+
"oneOf": [
14+
{
15+
"$ref": "#"
16+
},
17+
{
18+
"description": "Path to another config file to include",
19+
"type": "string"
20+
}
21+
]
22+
}
23+
}
24+
},
25+
"includeDirs": {
26+
"description": "A list of include directories to use when processing this codebase. Paths to dependencies are automatically added to this list.",
27+
"type": "array",
28+
"items": {
29+
"type": "string"
30+
}
31+
},
32+
"ignores": {
33+
"description": "Known inaccurate output which should be ignored",
34+
"type": "object",
35+
"properties": {
36+
"skip": {
37+
"description": "This is a list of filenames to skip entirely, for situations like when clangd infers a bad compile command",
38+
"type": "array",
39+
"items": {
40+
"type": "string"
41+
}
42+
},
43+
"add": {
44+
"description": "Ignores for suggestions to add includes",
45+
"type": "object",
46+
"properties": {
47+
"filenames": {
48+
"description": "This is a list of known filenames to skip when suggesting includes to add.",
49+
"type": "array",
50+
"items": {
51+
"type": "string"
52+
}
53+
},
54+
"headers": {
55+
"description": "This is a list of known headers where clangd produces a false positive when suggesting as includes to add.",
56+
"type": "array",
57+
"items": {
58+
"type": "string"
59+
}
60+
},
61+
"edges": {
62+
"description": "This is a list of known edges where clangd produces a false positive when suggesting as an include to add.",
63+
"type": "array",
64+
"items": {
65+
"type": "array",
66+
"minItems": 2,
67+
"maxItems": 2,
68+
"items": {
69+
"type": "string"
70+
}
71+
}
72+
}
73+
},
74+
"additionalProperties": false
75+
},
76+
"remove": {
77+
"description": "Ignores for suggestions to remove includes",
78+
"type": "object",
79+
"properties": {
80+
"filenames": {
81+
"description": "This is a list of known filenames to skip when suggesting unused includes. It's mostly a list of umbrella headers where the includes will appear to clangd to be unused, but are meant to be included.",
82+
"type": "array",
83+
"items": {
84+
"type": "string"
85+
}
86+
},
87+
"headers": {
88+
"description": "This is a list of known headers where clangd produces a false positive when suggesting as unused includes to remove. Usually these are umbrella headers, or headers where clangd thinks the canonical location for a symbol is actually in a forward declaration, causing it to flag the correct header as unused everywhere.",
89+
"type": "array",
90+
"items": {
91+
"type": "string"
92+
}
93+
},
94+
"edges": {
95+
"description": "This is a list of known edges where clangd produces a false positive when suggesting as unused includes to remove.",
96+
"type": "array",
97+
"items": {
98+
"type": "array",
99+
"minItems": 2,
100+
"maxItems": 2,
101+
"items": {
102+
"type": "string"
103+
}
104+
}
105+
}
106+
},
107+
"additionalProperties": false
108+
}
109+
}
110+
}
111+
},
112+
"additionalProperties": false
113+
}

configs/chromium.json

Lines changed: 226 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,226 @@
1+
{
2+
"includeDirs": [
3+
"base/third_party/xdg_mime",
4+
"base/third_party/double_conversion",
5+
"third_party/perfetto/include",
6+
"third_party/webrtc"
7+
],
8+
"dependencies": {
9+
"third_party/abseil-cpp": {
10+
"ignores": {
11+
"add": {
12+
"headers": [
13+
"absl/base/internal/inline_variable.h",
14+
"absl/types/internal/optional.h",
15+
"absl/types/optional.h"
16+
]
17+
}
18+
}
19+
},
20+
"third_party/skia": {
21+
"ignores": {
22+
"remove": {
23+
"headers": [
24+
"include/gpu/vk/GrVkVulkan.h"
25+
],
26+
"edges": [
27+
[
28+
"src/sksl/ir/SkSLProgram.h",
29+
"src/gpu/vk/GrVkCaps.h"
30+
]
31+
]
32+
}
33+
}
34+
},
35+
"v8": "./v8.json"
36+
},
37+
"ignores": {
38+
"add": {
39+
"headers": [
40+
"base/atomicops_internals_portable.h",
41+
"base/bind_internal.h",
42+
"base/callback_forward.h",
43+
"base/callback_internal.h",
44+
"base/hash/md5_constexpr_internal.h",
45+
"base/metrics/histogram_macros_internal.h",
46+
"base/numerics/safe_conversions_impl.h",
47+
"base/numerics/safe_math_clang_gcc_impl.h",
48+
"base/numerics/safe_math_shared_impl.h",
49+
"base/strings/string_piece_forward.h",
50+
"base/trace_event/trace_event_impl.h",
51+
"ui/base/metadata/metadata_macros_internal.h",
52+
"ui/gfx/image/image_skia_rep_default.h"
53+
]
54+
},
55+
"remove": {
56+
"filenames": [
57+
"base/numerics/safe_math.h",
58+
"base/trace_event/base_tracing.h",
59+
"mojo/public/cpp/system/core.h"
60+
],
61+
"headers": [
62+
"base/allocator/buildflags.h",
63+
"base/bind.h",
64+
"base/callback.h",
65+
"base/clang_profiling_buildflags.h",
66+
"base/compiler_specific.h",
67+
"base/containers/cxx20_erase.h",
68+
"base/hash/md5.h",
69+
"base/numerics/safe_math.h",
70+
"base/strings/string_piece.h",
71+
"base/trace_event/base_tracing.h",
72+
"base/trace_event/typed_macros.h",
73+
"build/branding_buildflags.h",
74+
"build/build_config.h",
75+
"build/chromecast_buildflags.h",
76+
"build/chromeos_buildflags.h",
77+
"chrome/browser/ui/browser.h",
78+
"chrome/browser/ui/browser_list.h",
79+
"chrome/common/buildflags.h",
80+
"components/safe_browsing/buildflags.h",
81+
"components/signin/public/base/signin_buildflags.h",
82+
"content/browser/renderer_host/render_frame_host_impl.h",
83+
"content/browser/web_contents/web_contents_impl.h",
84+
"extensions/buildflags/buildflags.h",
85+
"extensions/renderer/extension_frame_helper.h",
86+
"media/media_buildflags.h",
87+
"mojo/public/cpp/bindings/pending_receiver.h",
88+
"mojo/public/cpp/bindings/pending_remote.h",
89+
"mojo/public/cpp/bindings/receiver.h",
90+
"mojo/public/cpp/bindings/remote.h",
91+
"mojo/public/cpp/system/core.h",
92+
"ppapi/buildflags/buildflags.h",
93+
"printing/buildflags/buildflags.h",
94+
"testing/gtest/include/gtest/gtest_prod.h",
95+
"third_party/blink/renderer/core/html/html_element.h",
96+
"third_party/blink/renderer/platform/graphics/paint/paint_filter.h",
97+
"third_party/blink/renderer/platform/wtf/text/atomic_string.h",
98+
"third_party/blink/renderer/platform/wtf/text/wtf_string.h",
99+
"ui/aura/window.h",
100+
"ui/gfx/image/image_skia_rep.h"
101+
],
102+
"edges": [
103+
[
104+
"base/allocator/partition_allocator/address_pool_manager.h",
105+
"base/allocator/partition_allocator/address_pool_manager_bitmap.h"
106+
],
107+
[
108+
"base/allocator/partition_allocator/partition_alloc_check.h",
109+
"base/debug/alias.h"
110+
],
111+
[
112+
"base/atomicops.h",
113+
"base/atomicops_internals_portable.h"
114+
],
115+
[
116+
"base/debug/crash_logging.h",
117+
"base/strings/string_number_conversions.h"
118+
],
119+
[
120+
"base/gtest_prod_util.h",
121+
"testing/gtest/include/gtest/gtest_prod.h"
122+
],
123+
[
124+
"base/hash/md5_constexpr.h",
125+
"base/hash/md5_constexpr_internal.h"
126+
],
127+
[
128+
"base/memory/aligned_memory.h",
129+
"base/bits.h"
130+
],
131+
[
132+
"base/numerics/safe_math_shared_impl.h",
133+
"base/numerics/safe_math_clang_gcc_impl.h"
134+
],
135+
[
136+
"base/trace_event/typed_macros.h",
137+
"base/tracing/protos/chrome_track_event.pbzero.h"
138+
],
139+
[
140+
"chrome/browser/ui/browser.h",
141+
"chrome/browser/ui/signin_view_controller.h"
142+
],
143+
[
144+
"components/download/public/common/download_item_rename_progress_update.h",
145+
"components/enterprise/common/download_item_reroute_info.h"
146+
],
147+
[
148+
"content/public/common/common_param_traits.h",
149+
"content/public/common/common_param_traits_macros.h"
150+
],
151+
[
152+
"ipc/ipc_message_macros.h",
153+
"base/task/common/task_annotator.h"
154+
],
155+
[
156+
"gpu/command_buffer/service/gl_utils.h",
157+
"ui/gl/gl_bindings.h"
158+
],
159+
[
160+
"media/base/ipc/media_param_traits.h",
161+
"media/base/ipc/media_param_traits_macros.h"
162+
],
163+
[
164+
"mojo/public/cpp/bindings/lib/serialization.h",
165+
"mojo/public/cpp/bindings/array_traits_stl.h"
166+
],
167+
[
168+
"mojo/public/cpp/bindings/lib/serialization.h",
169+
"mojo/public/cpp/bindings/map_traits_stl.h"
170+
],
171+
[
172+
"services/network/public/cpp/url_request_mojom_traits.h",
173+
"services/network/public/cpp/resource_request.h"
174+
],
175+
[
176+
"skia/config/SkUserConfig.h",
177+
"skia/ext/skia_histogram.h"
178+
],
179+
[
180+
"third_party/blink/renderer/core/dom/events/event_target.h",
181+
"third_party/blink/renderer/core/event_type_names.h"
182+
],
183+
[
184+
"third_party/blink/renderer/core/frame/web_feature.h",
185+
"third_party/blink/public/mojom/web_feature/web_feature.mojom-blink.h"
186+
],
187+
[
188+
"third_party/blink/renderer/core/page/page.h",
189+
"third_party/blink/public/mojom/page/page.mojom-blink.h"
190+
],
191+
[
192+
"third_party/blink/renderer/core/probe/core_probes.h",
193+
"third_party/blink/renderer/core/core_probes_inl.h"
194+
],
195+
[
196+
"third_party/blink/renderer/platform/wtf/allocator/allocator.h",
197+
"base/allocator/partition_allocator/partition_alloc.h"
198+
],
199+
[
200+
"third_party/blink/renderer/platform/wtf/hash_table.h",
201+
"third_party/blink/renderer/platform/wtf/hash_iterators.h"
202+
],
203+
[
204+
"third_party/blink/renderer/platform/wtf/text/string_concatenate.h",
205+
"third_party/blink/renderer/platform/wtf/text/string_operators.h"
206+
],
207+
[
208+
"third_party/blink/renderer/platform/wtf/text/atomic_string.h",
209+
"third_party/blink/renderer/platform/wtf/text/string_concatenate.h"
210+
],
211+
[
212+
"ui/accessibility/ax_tree.h",
213+
"base/metrics/histogram_functions.h"
214+
],
215+
[
216+
"ui/gfx/image/image_skia_rep.h",
217+
"ui/gfx/image/image_skia_rep_default.h"
218+
],
219+
[
220+
"ui/gfx/image/image_skia_rep_default.h",
221+
"cc/paint/paint_op_buffer.h"
222+
]
223+
]
224+
}
225+
}
226+
}

configs/node.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"ignores": {
3+
"add": {},
4+
"remove": {
5+
"headers": [
6+
"v8.h"
7+
],
8+
"edges": [
9+
[
10+
"deps/icu-small/source/common/unicode/umachine.h",
11+
"unicode/urename.h"
12+
]
13+
]
14+
}
15+
}
16+
}

configs/v8.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"ignores": {
3+
"add": {
4+
"headers": [
5+
"v8-internal.h"
6+
]
7+
},
8+
"remove": {
9+
"headers": [
10+
"include/v8.h",
11+
"src/execution/frame-constants.h"
12+
],
13+
"edges": [
14+
[
15+
"src/wasm/wasm-objects.h",
16+
"src/wasm/stacks.h"
17+
]
18+
]
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)