Skip to content

Commit 841e190

Browse files
perheldCopilot
andauthored
Switch CPPCHECK to broad coverage with excludes (#19909)
Switch lintrunner cppcheck include pattern to include all files and rely on the exclude pattern to not lint files. This has the positive side effect that new files would be included in the linting and the exclude list can have a nice sorting and comments why things have ended up there. The end goal should of course be a empty exclude_patterns list. Change-Id: Id815fcbf7a6ba901b6d1b1ace4209ff157a15d7e cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani --------- Signed-off-by: Per Held <per.held@arm.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent f2252a6 commit 841e190

1 file changed

Lines changed: 98 additions & 8 deletions

File tree

.lintrunner.toml

Lines changed: 98 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,106 @@ is_formatter = true
109109
[[linter]]
110110
code = 'CPPCHECK'
111111
include_patterns = [
112-
'backends/arm/**/*.cpp',
113-
'backends/arm/**/*.h',
114-
'backends/arm/**/*.hpp',
115-
'backends/cortex_m/**/*.cpp',
116-
'backends/cortex_m/**/*.h',
117-
'examples/arm/**/*.cpp',
118-
'examples/arm/**/*.h',
119-
'examples/arm/**/*.hpp',
112+
'**/*.cpp',
113+
'**/*.h',
114+
'**/*.hpp',
120115
]
121116
exclude_patterns = [
117+
# Third-party and vendored code.
118+
'third-party/**',
119+
'third_party/**',
120+
'**/third-party/**',
121+
'**/third_party/**',
122+
123+
# Mirrored sources under src/ (Python package layout). Prefer linting canonical paths.
124+
'src/executorch/**',
125+
# PyTorch compatibility code kept in sync with upstream.
126+
'runtime/core/portable_type/c10/**',
127+
128+
# Generated sources, templates, and codegen tooling to onboard separately.
129+
'codegen/templates/**',
130+
'codegen/tools/selective_build.cpp',
131+
'exir/_serialize/**',
132+
133+
# Backend-owned code to onboard separately.
134+
'backends/aoti/**',
135+
'backends/apple/**',
136+
'backends/cadence/**',
137+
'backends/cuda/**',
138+
'backends/mediatek/**',
139+
'backends/mlx/**',
140+
'backends/nxp/**',
141+
'backends/openvino/**',
142+
'backends/qualcomm/**',
143+
'backends/samsung/**',
144+
'backends/test/**',
145+
'backends/vulkan/**',
146+
'backends/webgpu/**',
147+
'backends/xnnpack/**',
148+
149+
# Backend-owned examples to onboard with those backends.
150+
'examples/demo-apps/**',
151+
'examples/mediatek/**',
152+
'examples/nxp/**',
153+
'examples/qualcomm/**',
154+
'examples/samsung/**',
155+
156+
# Other examples to onboard separately.
157+
'examples/devtools/**',
158+
'examples/llm_manual/**',
159+
'examples/models/**',
160+
'examples/portable/**',
161+
'examples/raspberry_pi/**',
162+
163+
# EXIR and devtools areas to onboard separately.
164+
'devtools/bundled_program/**',
165+
'devtools/etdump/**',
166+
'exir/backend/test/**',
167+
'exir/tests/**',
168+
'exir/verification/**',
169+
170+
# Extension areas to onboard incrementally.
171+
'extension/android/**',
172+
'extension/apple/**',
173+
'extension/asr/runner/transducer_runner.h',
174+
'extension/aten_util/**',
175+
'extension/benchmark/apple/**',
176+
'extension/data_loader/**',
177+
'extension/evalue_util/**',
178+
'extension/flat_tensor/**',
179+
'extension/kernel_util/make_boxed_from_unboxed_functor.h',
180+
'extension/kernel_util/test/**',
181+
'extension/llm/**',
182+
'extension/memory_allocator/**',
183+
'extension/module/**',
184+
'extension/named_data_map/**',
185+
'extension/pybindings/**',
186+
'extension/pytree/**',
187+
'extension/runner_util/**',
188+
'extension/tensor/**',
189+
'extension/testing_util/**',
190+
'extension/threadpool/**',
191+
'extension/training/**',
192+
'extension/wasm/**',
193+
194+
# Kernel areas to onboard separately.
195+
'kernels/aten/**',
196+
'kernels/optimized/**',
197+
'kernels/portable/**',
198+
'kernels/prim_ops/**',
199+
'kernels/quantized/**',
200+
'kernels/test/**',
201+
202+
# Runtime areas to onboard incrementally.
203+
'runtime/backend/**',
204+
'runtime/core/**',
205+
'runtime/executor/**',
206+
'runtime/kernel/**',
207+
'runtime/platform/**',
208+
209+
# Top-level test and platform integration areas.
210+
'test/**',
211+
'zephyr/**',
122212
]
123213
command = [
124214
'python',

0 commit comments

Comments
 (0)