diff --git a/tools/ci/sg_rules/no_stdint_include_in_soc_reg_header.yml b/tools/ci/sg_rules/no_stdint_include_in_soc_reg_header.yml new file mode 100644 index 0000000000..f9e29de0b2 --- /dev/null +++ b/tools/ci/sg_rules/no_stdint_include_in_soc_reg_header.yml @@ -0,0 +1,17 @@ +# Refer to https://ast-grep.github.io/guide/rule-config.html for Rule Essentials +id: no-stdint-include-in-soc-reg-header +message: Don't include in soc *reg.h headers +severity: error # error, warning, info, hint +note: Please remove '#include ' from soc *reg.h headers +language: C +files: + - "components/soc/**/*reg.h" +rule: + kind: preproc_include + has: + field: path + pattern: $N +constraints: + N: + regex: '^["<]stdint\.h[">]' # match "stdint.h" or +fix: ''