diff options
author | Rob Herring <robh@kernel.org> | 2020-10-09 20:05:57 +0300 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2020-10-12 17:11:04 +0300 |
commit | 44ec8b20d1e9ceabe49bc6af059220e099bbee20 (patch) | |
tree | e628b5cf3f205a80e25e1849a6323668d8b23e0b /Documentation/devicetree/bindings/Makefile | |
parent | 16b0b2baaf83f0fed8fa561d40a1bd3cefae454a (diff) | |
download | linux-44ec8b20d1e9ceabe49bc6af059220e099bbee20.tar.xz |
dt-bindings: Add running yamllint to dt_binding_check
Add a yamllint config file and support for running yamllint on DT
binding schema files. This runs on the whole tree as yamllint is Python
and suffers from Python's slow startup times.
Users can run on individual files doing:
yamllint -c Documentation/devicetree/bindings/.yamllint <binding file>
Link: https://lore.kernel.org/r/20201009170557.168785-1-robh@kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'Documentation/devicetree/bindings/Makefile')
-rw-r--r-- | Documentation/devicetree/bindings/Makefile | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile index ec8073cb2e71..f50420099a55 100644 --- a/Documentation/devicetree/bindings/Makefile +++ b/Documentation/devicetree/bindings/Makefile @@ -3,6 +3,8 @@ DT_DOC_CHECKER ?= dt-doc-validate DT_EXTRACT_EX ?= dt-extract-example DT_MK_SCHEMA ?= dt-mk-schema +DT_SCHEMA_LINT = $(shell which yamllint) + DT_SCHEMA_MIN_VERSION = 2020.8.1 PHONY += check_dtschema_version @@ -24,6 +26,10 @@ find_cmd = find $(srctree)/$(src) \( -name '*.yaml' ! \ -name 'processed-schema*' ! \ -name '*.example.dt.yaml' \) +quiet_cmd_yamllint = LINT $(src) + cmd_yamllint = $(find_cmd) | \ + xargs $(DT_SCHEMA_LINT) -f parsable -c $(srctree)/$(src)/.yamllint + quiet_cmd_chk_bindings = CHKDT $@ cmd_chk_bindings = $(find_cmd) | \ xargs -n200 -P$$(nproc) $(DT_DOC_CHECKER) -u $(srctree)/$(src) @@ -37,6 +43,7 @@ quiet_cmd_mk_schema = SCHEMA $@ rm -f $$f define rule_chkdt + $(if $(DT_SCHEMA_LINT),$(call cmd,yamllint),) $(call cmd,chk_bindings) $(call cmd,mk_schema) endef @@ -48,7 +55,7 @@ override DTC_FLAGS := \ -Wno-graph_child_address \ -Wno-interrupt_provider -$(obj)/processed-schema-examples.json: $(DT_DOCS) check_dtschema_version FORCE +$(obj)/processed-schema-examples.json: $(DT_DOCS) $(src)/.yamllint check_dtschema_version FORCE $(call if_changed_rule,chkdt) ifeq ($(DT_SCHEMA_FILES),) |