From patchwork Fri Oct 9 17:05:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 317576 Delivered-To: patch@linaro.org Received: by 2002:a92:d603:0:0:0:0:0 with SMTP id w3csp2493139ilm; Fri, 9 Oct 2020 10:06:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuaWutk9YXTji5/XLEZ7PPtgdJ/xbk8N4CKT4EUxWxsZgAsTb7dqm1sFHGvAp3DuADCI/m X-Received: by 2002:a17:906:f14b:: with SMTP id gw11mr15209630ejb.41.1602263162889; Fri, 09 Oct 2020 10:06:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602263162; cv=none; d=google.com; s=arc-20160816; b=aOEQy65JwPRqW1jVPX7iGk8svhzeygrLMdj88CNsp0eaat3qO4aHqce/e3LsPUITrR SsPnBIpN/O3RfhMFGPyKPfiiCwghFn8R4tmzgeQArjH4hLSoQXTlvq/R83Xr4ALHlR8y MPrkqN1cFPLzKJYqdLGyAXVA6/8mu8sjK5fQZ5MjtrQa+EK6BvylxADVaaeYwKRvTa0Z JZyquZ5IaAdh7ql/rBsdgSNntMW+SPSHDCwskpGRl/wGu0JUdYPL9XUn/lPk3ZCQaIik 0Z07JYDUbFVlyZimB8vQKcQ8W8sJnq/hQRj0P2uZPaJ0GtycWYMjwO8coPTkZjVvcgnX R0Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Hahw4Z+pkoPGKYqMxdiIRA4sO3mk0rSthtnfTsKHy7k=; b=hX3lqTeNutlPDtqNIBCnpqRA6Vbd1tOFLT9l+QN8IKsR+BV5Uz3XnWHtuUAY0qsN9E UgThrmAYwLggYxt8LdCfWcEoThgEjDV9ngj//9LHq+37HnU5iG92NqLXZhuZrOGg6j6+ fVtkU7+D2ko387v8yf8QhmQeb8swhjfDYhP8lzZoWuERJp3s3lJpDs9yhcA76y+uZxLz LJBsQbJDV6LNdO0UNKSbTqNQRitdDlFu7oA41e0SOsTUjKNcBejdEKdPvn0Roh6JP/2N HZ1zXbCFCUpKQFYvQAr5Vea6GLhSEon+jujUa9sixNOoaSyovP3rhDz3Usj2dBUJOyAo IZag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p17si6573529edx.292.2020.10.09.10.06.02; Fri, 09 Oct 2020 10:06:02 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389858AbgJIRGC (ORCPT + 6 others); Fri, 9 Oct 2020 13:06:02 -0400 Received: from mail-ot1-f47.google.com ([209.85.210.47]:43400 "EHLO mail-ot1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389529AbgJIRGC (ORCPT ); Fri, 9 Oct 2020 13:06:02 -0400 Received: by mail-ot1-f47.google.com with SMTP id n61so9603520ota.10; Fri, 09 Oct 2020 10:06:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Hahw4Z+pkoPGKYqMxdiIRA4sO3mk0rSthtnfTsKHy7k=; b=UdeL3tGFgx8Kvmz08I3+m4QfCRologaggI9T5ZDlD68vjXAnge6k0YWrouUPzx+R/I EuduGG0WQJx6dJxsmTXVADkY52wIbxkfGUvklcLdRwjT6qqDiytm/aX39+bckZlpw72U Ae+QhDSc6SuvQdvJQ263NvpJWvTfJVh2PLLcHaLaqomrbU/hIAs5eyFRES8Hpvqa41Fd FPIIL93uu1lx5AG7NApb+sF+MfSPmMNe33Zr5jawTzhj6tgKj4fJ0EtejVVn+m9KiWdr NKbdcpubJIYiZSjojShaDTnN3ryrWhOONqAexPoR3V1KNNhOnDoA6Xv8W+XMYg8UbdEV +Zyg== X-Gm-Message-State: AOAM530VTA5zIUcDYAzbt8ZktNZFvfRM438my0fZ+cbXgP6em9YzXpWo HK9UQsVDK6GkSPzUjdRcXeQ3xWQXC/cd X-Received: by 2002:a05:6830:1f4d:: with SMTP id u13mr9075478oth.184.1602263159959; Fri, 09 Oct 2020 10:05:59 -0700 (PDT) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id r188sm167207oia.13.2020.10.09.10.05.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Oct 2020 10:05:59 -0700 (PDT) From: Rob Herring To: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] dt-bindings: Add running yamllint to dt_binding_check Date: Fri, 9 Oct 2020 12:05:57 -0500 Message-Id: <20201009170557.168785-1-robh@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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 Signed-off-by: Rob Herring --- Documentation/devicetree/bindings/.yamllint | 39 +++++++++++++++++++++ Documentation/devicetree/bindings/Makefile | 9 ++++- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/.yamllint -- 2.25.1 diff --git a/Documentation/devicetree/bindings/.yamllint b/Documentation/devicetree/bindings/.yamllint new file mode 100644 index 000000000000..214abd3ec440 --- /dev/null +++ b/Documentation/devicetree/bindings/.yamllint @@ -0,0 +1,39 @@ +extends: relaxed + +rules: + line-length: + # 80 chars should be enough, but don't fail if a line is longer + max: 110 + allow-non-breakable-words: true + level: warning + braces: + min-spaces-inside: 0 + max-spaces-inside: 1 + min-spaces-inside-empty: 0 + max-spaces-inside-empty: 0 + brackets: + min-spaces-inside: 0 + max-spaces-inside: 1 + min-spaces-inside-empty: 0 + max-spaces-inside-empty: 0 + colons: {max-spaces-before: 0, max-spaces-after: 1} + commas: {min-spaces-after: 1, max-spaces-after: 1} + comments: + require-starting-space: false + min-spaces-from-content: 1 + comments-indentation: disable + document-start: + present: true + empty-lines: + max: 3 + max-end: 1 + empty-values: + forbid-in-block-mappings: true + forbid-in-flow-mappings: true + hyphens: + max-spaces-after: 1 + indentation: + spaces: 2 + indent-sequences: true + check-multi-line-strings: false + trailing-spaces: false 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),)