Received: by 10.223.185.116 with SMTP id b49csp1098883wrg; Fri, 16 Feb 2018 12:25:51 -0800 (PST) X-Google-Smtp-Source: AH8x225qlEKr9DFDF5TT4PUQROOPqxt9vEiFsMcTyCbH0CGaljWSGGoZnJXYJSuP+ywR9TdDNovk X-Received: by 10.99.124.2 with SMTP id x2mr6150852pgc.184.1518812751503; Fri, 16 Feb 2018 12:25:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518812751; cv=none; d=google.com; s=arc-20160816; b=udy3kUDJM3Zbgr/rEuXKMVZPUqouk+zuvQLqt0JFxTg/y/qn3PhrTIblkvZVufvT/G ngRAqyGm3wxypTMNbgRRaUCIJdyy7onaCyrMw5xHa/mS5pfR9/wi68R4jOmBCZruK3XB k6pCgSwoJfpGceZnKEZkunPsIGeW1p5cEuq65/Cx+GG26XGpyuiP0AjQmyaLDiWjfW5W 1AGzWG3v3hiIygXb6O6p6ldd3qIDiGZuIEsAXrJfj950HTmOI8Tv7YCJenJbGMRJccjq ZP8x6SJvRdvBvyBPFZA8QiOUd4f3kof7APv2/5wQbqElJ1ZxbYEpp2uWubHQohfL2SOG c+5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=GiDPzq0tAhrN94gDhwz74x5bAG28IIN0OTyxiKyXGZA=; b=A/x3QVkaDlcA7yNGwRDzya/+zKbEXJeDcaSZ18cFSB+TQiuZZ62Qiq0pz49KtX2Kl4 Gfz6V4Jn5upZ5xPdIim6mqrtj2xOkezwcyFDrMFZQ5YuKaa2gZrgs9ed6EqNBZXGU0Uc qk6Td1OM4/Y1QvjZSyQe3c59uer+qK2mOnCjkNgTZviBH6NYkiKXjifY1dmM4TltIvqt KXBDkGvtdRLBa6TJcX0LVPDOCdv6riOjG2tI3uU5/8auCF3aqAP3gGP1DRLac+Vto0Y7 uTf8yNTS/6qgXhXtRuJIGiewwDQA6e+WZ9bEcYWasnwNiHEjFE/QPx6LR19gwLBCiFme tvDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=i4zpc34p; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t125si2756431pgc.38.2018.02.16.12.25.37; Fri, 16 Feb 2018 12:25:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=i4zpc34p; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750808AbeBPUX2 (ORCPT + 99 others); Fri, 16 Feb 2018 15:23:28 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:41933 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750713AbeBPUX0 (ORCPT ); Fri, 16 Feb 2018 15:23:26 -0500 Received: by mail-lf0-f66.google.com with SMTP id f136so5634903lff.8; Fri, 16 Feb 2018 12:23:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=GiDPzq0tAhrN94gDhwz74x5bAG28IIN0OTyxiKyXGZA=; b=i4zpc34pMXW+paiWyMfdDR2jMEtnL2sMdWI951tcG3VZa54D4C3OkuBjvQB5FMcYD1 9PpeFDfeB9DU0eAlYdkNLciLYT6dDmlwlvXOPJq0J/h0Mr6lc5dd5KPhN/8l/xBhK9iX G7hHyS7Qj45AfOqYMQ1TEJytY+StTgnIglgDaLfIQbZclmht8gQvp2b8gX25E65gWuTz WuUxWvQYa7qMRZRhR1NPWCneKIlSWg4GcqcfmMftNG/AUqUR3ULJe1R9iDeqQ6mKpM+0 FWNhomrddcCfQT8TJT0FOjwGi9sZ7NuwB7kMBmmyQmnpL3g7Vd6TwJj4q7j5T6PqknIJ Qqnw== 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; bh=GiDPzq0tAhrN94gDhwz74x5bAG28IIN0OTyxiKyXGZA=; b=MAGzz33PATqe1guxFGWoTxmIGL+Hacw+2vk69Ep0hdvP8qB2TjQ+6Hr70NLq2vNaB0 0W5jm8O+pTf+rNwNK9HYrR13B+/vDUkN5BMnw7ItbWEkVEPxiijvIDkcDPpVC+xN7lik LxQy+zwHzYQzYnbD5kZCnR4iRkBaENeDTu/pywUXXYvsUaSRDNmPoecFIUtkvFuKVMYN eDU9PvdOyLusYqCNv6NLo7scObwdGzqZtj6FMHMW172WvSfHJfdL87diHG0O45sGDG+A F+8DMX2/yMTf6yiD4mSjWLevu1q7XPY322Qz3gK22yrfci6FDtWogk8/OJ61jnaJ6+wl qqrQ== X-Gm-Message-State: APf1xPC5r2zamIk0eGukcD8RMKehjeaFPhhnZP6RNqNhdUYrKf6JU4ca nuPRjVi9c1Yl0Ug/+HRJPM5Zfgno X-Received: by 10.25.83.10 with SMTP id h10mr5242896lfb.121.1518812604721; Fri, 16 Feb 2018 12:23:24 -0800 (PST) Received: from huvuddator.lan (ua-213-113-106-221.cust.bredbandsbolaget.se. [213.113.106.221]) by smtp.gmail.com with ESMTPSA id y7sm1652539ljd.45.2018.02.16.12.23.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Feb 2018 12:23:24 -0800 (PST) From: Ulf Magnusson To: apw@canonical.com, joe@perches.com Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, Ulf Magnusson Subject: [PATCH 0/3] Improve and extend checkpatch.pl Kconfig help text checks Date: Fri, 16 Feb 2018 21:22:52 +0100 Message-Id: <20180216202255.25307-1-ulfalizer@gmail.com> X-Mailer: git-send-email 2.14.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, This patchset contains some improvements for the Kconfig help text check in scripts/checkconfig.pl: - Commits 1 and 2 make the check more robust by checking menuconfig symbols and choices as well as symbols defined with 'config', and by making the detection of definition boundaries more reliable. - Commit 3 adds a check for new '---help---'s being introduced. IMO, 'help' should be encouraged in new code. All three commits can be applied independently. The existing code is a bit weird in that it doesn't require symbols with "long" definitions (e.g., many selects) to have help texts. Fixing that is outside the scope of this patchset. I couldn't tell if it was deliberate. I'm a Perl noob, so check for bad practices. :) The changes were tested by running 'checkpatch.pl -f' on some large existing Kconfig files in the kernel and looking for false positives (e.g. arch/{x86,arm}/Kconfig). This test file was also used, which contains some cases that confused the old code: config BAD_1 bool "bad 1" config BAD_2 bool 'bad 2' config BAD_3 bool "bad 3" help 1 2 3 menuconfig BAD_4 bool "bad 4" help 1 2 3 config BAD_5 bool prompt "bad 5" help 1 2 3 config BAD_6 bool "bad 6" help 1 2 3 if FOO config BAD_7 bool "bad 7" help 1 2 3 endif config BAD_8 bool "bad 8" help 1 2 3 source "foo" config BAD_9 bool "bad 9" ---help--- 1 2 3 4 choice bool "bad choice" help 1 2 3 endchoice config OK_1 bool config OK_2 bool "ok 2" help 1 2 3 4 config OK_3 tristate "ok 3" help 1 2 3 4 config OK_4 tristate prompt "ok 4" help 1 2 3 4 choice bool "ok choice" help 1 2 3 4 endchoice This now produces the following warnings: WARNING: please write a paragraph that describes the config symbol fully #9: FILE: Kconfig.test_help_check:9: +config BAD_1 WARNING: please write a paragraph that describes the config symbol fully #12: FILE: Kconfig.test_help_check:12: +config BAD_2 WARNING: please write a paragraph that describes the config symbol fully #15: FILE: Kconfig.test_help_check:15: +config BAD_3 WARNING: please write a paragraph that describes the config symbol fully #22: FILE: Kconfig.test_help_check:22: +menuconfig BAD_4 WARNING: please write a paragraph that describes the config symbol fully #29: FILE: Kconfig.test_help_check:29: +config BAD_5 WARNING: please write a paragraph that describes the config symbol fully #37: FILE: Kconfig.test_help_check:37: +config BAD_6 WARNING: please write a paragraph that describes the config symbol fully #46: FILE: Kconfig.test_help_check:46: +config BAD_7 WARNING: please write a paragraph that describes the config symbol fully #55: FILE: Kconfig.test_help_check:55: +config BAD_8 WARNING: prefer 'help' over '---help---' for new help texts #64: FILE: Kconfig.test_help_check:64: +config BAD_9 WARNING: please write a paragraph that describes the config symbol fully #72: FILE: Kconfig.test_help_check:72: +choice total: 0 errors, 10 warnings, 117 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. Kconfig.test_help_check has style problems, please review. NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. Cheers, Ulf Ulf Magnusson (3): checkpatch: kconfig: recognize more prompts when checking help texts checkpatch: kconfig: check help texts for menuconfig and choice checkpatch: kconfig: prefer 'help' over '---help---' scripts/checkpatch.pl | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) -- 2.14.1