Use Coccinelle's "depends on" directive to exclude files from certain transformations. This should make them a bit simpler and possibly faster, since we don't have to shell out to Python. Unfortunately, this works only for file/directory exclusions. For function and other more complex exclusions we still need to use Python, at least for now. Also, completely drop the file exclusion for man/ in the xsprintf transformation, since we filter out everything under man/ before we even run Coccinelle (in run-coccinelle.sh).
22 lines
648 B
Plaintext
22 lines
648 B
Plaintext
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
/* Disable this transformation on test-json.c */
|
|
@ depends on !(file in "src/test/test-json.c") @
|
|
expression key, val;
|
|
@@
|
|
(
|
|
- SD_JSON_BUILD_PAIR(key, SD_JSON_BUILD_BOOLEAN(val))
|
|
+ SD_JSON_BUILD_PAIR_BOOLEAN(key, val)
|
|
|
|
|
- SD_JSON_BUILD_PAIR(key, SD_JSON_BUILD_INTEGER(val))
|
|
+ SD_JSON_BUILD_PAIR_INTEGER(key, val)
|
|
|
|
|
- SD_JSON_BUILD_PAIR(key, SD_JSON_BUILD_STRING(val))
|
|
+ SD_JSON_BUILD_PAIR_STRING(key, val)
|
|
|
|
|
- SD_JSON_BUILD_PAIR(key, SD_JSON_BUILD_UNSIGNED(val))
|
|
+ SD_JSON_BUILD_PAIR_UNSIGNED(key, val)
|
|
|
|
|
- SD_JSON_BUILD_PAIR(key, SD_JSON_BUILD_VARIANT(val))
|
|
+ SD_JSON_BUILD_PAIR_VARIANT(key, val)
|
|
)
|