Skip to contentSkip to conversation

dt-bindings: kbuild: Print a warning if yamllint is not found

PATCH In review Rob Herring 3 participants 4 messages Mar 3, 2022 – Mar 4, 2022 Device tree bindings

lore
Share & tools
lore

Rob Herring

author maintainer
#0 lore raw

PATCH 1/1 dt-bindings: kbuild: Print a warning if yamllint is not found

Running yamllint is effectively required for binding schemas, so print a warning if not found rather than silently skipping running it.

---
 Documentation/devicetree/bindings/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/Makefile +2 -1
index 5138d10e0601..61ec18ecc931 100644
@@ -3,7 +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_LINT := $(shell which yamllint || \
+  echo "warning: yamllint not installed, skipping. To install, run 'pip install yamllint'" >&2)
 
 DT_SCHEMA_MIN_VERSION = 2021.2.1
 
Signature · 1 line
2.32.0
#2 lore raw
In reply to Rob Herring

Hi Rob,

Quoted 4 lines · Rob Herring

Running yamllint is effectively required for binding schemas, so print a warning if not found rather than silently skipping running it.

Thanks for your patch!

Documentation/devicetree/bindings/Makefile DT_DOC_CHECKER ?= dt-doc-validate · line 7

Quoted 9 lines
Documentation/devicetree/bindings/Makefile +2 -1
@@ -3,7 +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_LINT := $(shell which yamllint || \
+  echo "warning: yamllint not installed, skipping. To install, run 'pip install yamllint'" >&2)

Do we want to encourage people to use pip, instead of their distro's package manager? At least Debian/Ubuntu provide yamllint packages.

So perhaps drop the install rule?

Documentation/devicetree/bindings/Makefile DT_DOC_CHECKER ?= dt-doc-validate · line 9

Quoted 2 lines
Documentation/devicetree/bindings/Makefile +0 -0
 DT_SCHEMA_MIN_VERSION = 2021.2.1

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

author maintainer
#3 lore raw
Quoted 16 lines · Geert Uytterhoeven

Hi Rob,

Quoted 4 lines · Rob Herring

Running yamllint is effectively required for binding schemas, so print a warning if not found rather than silently skipping running it.

Thanks for your patch!

Quoted 6 lines
Documentation/devicetree/bindings/Makefile +0 -0
@@ -3,7 +3,8 @@ DT_DOC_CHECKER ?= dt-doc-validate
 DT_EXTRACT_EX ?= dt-extract-example
 DT_MK_SCHEMA ?= dt-mk-schema
 
Quoted 8 lines

Documentation/devicetree/bindings/Makefile DT_DOC_CHECKER ?= dt-doc-validate · line 7

Quoted 3 lines
Documentation/devicetree/bindings/Makefile +2 -1
-DT_SCHEMA_LINT = $(shell which yamllint)
+DT_SCHEMA_LINT := $(shell which yamllint || \
+  echo "warning: yamllint not installed, skipping. To install, run 'pip install yamllint'" >&2)

Do we want to encourage people to use pip, instead of their distro's package manager? At least Debian/Ubuntu provide yamllint packages.

So perhaps drop the install rule?

Okay, that's what I originally had. I'm sure someone will want to document 'how to install yamllint' somewhere. Maybe I'll say:

warning: python package 'yamllint' not installed, skipping

To give some hint how to install.

I'm not sure exactly, but there is a minimum version of yamllint so it is possible the distro versions are too old. IIRC, unknown config settings throw an error. I think at the time I did the config everything had been around for at least a year or 2 and I don't think anyone has reported issues.

Rob