* [PATCH] checkpatch: allow optional shorter config descriptions
@ 2014-09-03 16:32 Vadim Bendebury
2014-09-04 9:18 ` Joe Perches
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Vadim Bendebury @ 2014-09-03 16:32 UTC (permalink / raw)
To: subssriprions
Cc: vb, Vadim Bendebury, Andy Whitcroft, Joe Perches, linux-kernel
This script is used by many other projects, and in some of them the
requirement of at least 4 line long description for all Kconfig items
is excessive. This patch adds a command line option to control the
required minimum length.
Tested running this script over a patch including a two line config
description. The script generated a warning when invoked as is, and
did not generate it when invoked with --min-conf-desc-length=2.
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
---
scripts/checkpatch.pl | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index b385bcb..8808bde 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -43,6 +43,7 @@ my $configuration_file = ".checkpatch.conf";
my $max_line_length = 80;
my $ignore_perl_version = 0;
my $minimum_perl_version = 5.10.0;
+my $min_conf_desc_length = 4;
sub help {
my ($exitcode) = @_;
@@ -63,6 +64,7 @@ Options:
--types TYPE(,TYPE2...) show only these comma separated message types
--ignore TYPE(,TYPE2...) ignore various comma separated message types
--max-line-length=n set the maximum line length, if exceeded, warn
+ --min-conf-desc-length=n set the min description length, if shorter, warn
--show-types show the message "types" in the output
--root=PATH PATH to the kernel tree root
--no-summary suppress the per-file summary
@@ -131,6 +133,7 @@ GetOptions(
'types=s' => \@use,
'show-types!' => \$show_types,
'max-line-length=i' => \$max_line_length,
+ 'min-conf-desc-length=i' => \$min_conf_desc_length,
'root=s' => \$root,
'summary!' => \$summary,
'mailback!' => \$mailback,
@@ -2281,7 +2284,8 @@ sub process {
$length++;
}
WARN("CONFIG_DESCRIPTION",
- "please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($is_start && $is_end && $length < 4);
+ "please write a paragraph that describes the config symbol fully\n" . $herecurr)
+ if ($is_start && $is_end && $length < $min_conf_desc_length);
#print "is_start<$is_start> is_end<$is_end> length<$length>\n";
}
--
2.1.0.rc2.206.gedb03e5
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] checkpatch: allow optional shorter config descriptions
2014-09-03 16:32 [PATCH] checkpatch: allow optional shorter config descriptions Vadim Bendebury
@ 2014-09-04 9:18 ` Joe Perches
2014-09-04 18:23 ` [PATCH v2] " Vadim Bendebury
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Joe Perches @ 2014-09-04 9:18 UTC (permalink / raw)
To: Vadim Bendebury
Cc: subssriprions, vb, Andy Whitcroft, linux-kernel, Andrew Morton
On Wed, 2014-09-03 at 09:32 -0700, Vadim Bendebury wrote:
> This script is used by many other projects, and in some of them the
> requirement of at least 4 line long description for all Kconfig items
> is excessive. This patch adds a command line option to control the
> required minimum length.
>
> Tested running this script over a patch including a two line config
> description. The script generated a warning when invoked as is, and
> did not generate it when invoked with --min-conf-desc-length=2.
>
> Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
> ---
>
> scripts/checkpatch.pl | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index b385bcb..8808bde 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -43,6 +43,7 @@ my $configuration_file = ".checkpatch.conf";
> my $max_line_length = 80;
> my $ignore_perl_version = 0;
> my $minimum_perl_version = 5.10.0;
> +my $min_conf_desc_length = 4;
>
> sub help {
> my ($exitcode) = @_;
> @@ -63,6 +64,7 @@ Options:
> --types TYPE(,TYPE2...) show only these comma separated message types
> --ignore TYPE(,TYPE2...) ignore various comma separated message types
> --max-line-length=n set the maximum line length, if exceeded, warn
> + --min-conf-desc-length=n set the min description length, if shorter, warn
> --show-types show the message "types" in the output
> --root=PATH PATH to the kernel tree root
> --no-summary suppress the per-file summary
> @@ -131,6 +133,7 @@ GetOptions(
> 'types=s' => \@use,
> 'show-types!' => \$show_types,
> 'max-line-length=i' => \$max_line_length,
> + 'min-conf-desc-length=i' => \$min_conf_desc_length,
> 'root=s' => \$root,
> 'summary!' => \$summary,
> 'mailback!' => \$mailback,
> @@ -2281,7 +2284,8 @@ sub process {
> $length++;
> }
> WARN("CONFIG_DESCRIPTION",
> - "please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($is_start && $is_end && $length < 4);
> + "please write a paragraph that describes the config symbol fully\n" . $herecurr)
> + if ($is_start && $is_end && $length < $min_conf_desc_length);
> #print "is_start<$is_start> is_end<$is_end> length<$length>\n";
> }
Fine by me, but I think think this is the
only checkpatch use of:
WARN(foo) if (test);
Every other checkpatch message block is:
if (test) {
WARN(foo);
}
so I would prefer to change this use
to match.
---
scripts/checkpatch.pl | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d89857d..af4659c1 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -43,6 +43,7 @@ my $configuration_file = ".checkpatch.conf";
my $max_line_length = 80;
my $ignore_perl_version = 0;
my $minimum_perl_version = 5.10.0;
+my $min_conf_desc_length = 4;
sub help {
my ($exitcode) = @_;
@@ -63,6 +64,7 @@ Options:
--types TYPE(,TYPE2...) show only these comma separated message types
--ignore TYPE(,TYPE2...) ignore various comma separated message types
--max-line-length=n set the maximum line length, if exceeded, warn
+ --min-conf-desc-length=n set the min description length, if shorter, warn
--show-types show the message "types" in the output
--root=PATH PATH to the kernel tree root
--no-summary suppress the per-file summary
@@ -131,6 +133,7 @@ GetOptions(
'types=s' => \@use,
'show-types!' => \$show_types,
'max-line-length=i' => \$max_line_length,
+ 'min-conf-desc-length=i' => \$min_conf_desc_length,
'root=s' => \$root,
'summary!' => \$summary,
'mailback!' => \$mailback,
@@ -2280,9 +2283,10 @@ sub process {
}
$length++;
}
- WARN("CONFIG_DESCRIPTION",
- "please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($is_start && $is_end && $length < 4);
- #print "is_start<$is_start> is_end<$is_end> length<$length>\n";
+ if ($is_start && $is_end && $length < $min_conf_desc_length) {
+ WARN("CONFIG_DESCRIPTION",
+ "please write a paragraph that describes the config symbol fully\n" . $herecurr);
+ }
}
# discourage the addition of CONFIG_EXPERIMENTAL in Kconfig.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2] checkpatch: allow optional shorter config descriptions
2014-09-03 16:32 [PATCH] checkpatch: allow optional shorter config descriptions Vadim Bendebury
2014-09-04 9:18 ` Joe Perches
@ 2014-09-04 18:23 ` Vadim Bendebury
2014-09-04 19:27 ` Joe Perches
2014-09-04 20:37 ` [PATCH v3] " Vadim Bendebury
2014-09-04 21:13 ` [PATCH v4] " Vadim Bendebury
3 siblings, 1 reply; 7+ messages in thread
From: Vadim Bendebury @ 2014-09-04 18:23 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm, Vadim Bendebury, Andy Whitcroft, Joe Perches
This script is used by many other projects, and in some of them the
requirement of at least 4 line long description for all Kconfig items
is excessive. This patch adds a command line option to control the
required minimum length.
Tested running this script over a patch including a two line config
description. The script generated a warning when invoked as is, and
did not generate it when invoked with --min-conf-desc-length=2.
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
---
Changes in v2:
- modified the condition check as requested
scripts/checkpatch.pl | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index b385bcb..b0adae9 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -43,6 +43,7 @@ my $configuration_file = ".checkpatch.conf";
my $max_line_length = 80;
my $ignore_perl_version = 0;
my $minimum_perl_version = 5.10.0;
+my $min_conf_desc_length = 4;
sub help {
my ($exitcode) = @_;
@@ -63,6 +64,7 @@ Options:
--types TYPE(,TYPE2...) show only these comma separated message types
--ignore TYPE(,TYPE2...) ignore various comma separated message types
--max-line-length=n set the maximum line length, if exceeded, warn
+ --min-conf-desc-length=n set the min description length, if shorter, warn
--show-types show the message "types" in the output
--root=PATH PATH to the kernel tree root
--no-summary suppress the per-file summary
@@ -131,6 +133,7 @@ GetOptions(
'types=s' => \@use,
'show-types!' => \$show_types,
'max-line-length=i' => \$max_line_length,
+ 'min-conf-desc-length=i' => \$min_conf_desc_length,
'root=s' => \$root,
'summary!' => \$summary,
'mailback!' => \$mailback,
@@ -2280,8 +2283,10 @@ sub process {
}
$length++;
}
- WARN("CONFIG_DESCRIPTION",
- "please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($is_start && $is_end && $length < 4);
+ if ($is_start && $is_end && $length < $min_conf_desc_length) {
+ WARN("CONFIG_DESCRIPTION",
+ "please write a paragraph that describes the config symbol fully\n" . $herecurr)
+ }
#print "is_start<$is_start> is_end<$is_end> length<$length>\n";
}
--
2.1.0.rc2.206.gedb03e5
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] checkpatch: allow optional shorter config descriptions
2014-09-04 18:23 ` [PATCH v2] " Vadim Bendebury
@ 2014-09-04 19:27 ` Joe Perches
0 siblings, 0 replies; 7+ messages in thread
From: Joe Perches @ 2014-09-04 19:27 UTC (permalink / raw)
To: Vadim Bendebury; +Cc: linux-kernel, akpm, Andy Whitcroft
On Thu, 2014-09-04 at 11:23 -0700, Vadim Bendebury wrote:
> This script is used by many other projects, and in some of them the
> requirement of at least 4 line long description for all Kconfig items
> is excessive. This patch adds a command line option to control the
> required minimum length.
>
> Tested running this script over a patch including a two line config
> description. The script generated a warning when invoked as is, and
> did not generate it when invoked with --min-conf-desc-length=2.
>
> Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
> ---
>
> Changes in v2:
> - modified the condition check as requested
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -2280,8 +2283,10 @@ sub process {
> }
> $length++;
> }
> - WARN("CONFIG_DESCRIPTION",
> - "please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($is_start && $is_end && $length < 4);
> + if ($is_start && $is_end && $length < $min_conf_desc_length) {
> + WARN("CONFIG_DESCRIPTION",
> + "please write a paragraph that describes the config symbol fully\n" . $herecurr)
> + }
> #print "is_start<$is_start> is_end<$is_end> length<$length>\n";
> }
>
Thank you but this is not quite right.
checkpatch uses tabs for indentation.
You've used 4 spaces for the WARN.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v3] checkpatch: allow optional shorter config descriptions
2014-09-03 16:32 [PATCH] checkpatch: allow optional shorter config descriptions Vadim Bendebury
2014-09-04 9:18 ` Joe Perches
2014-09-04 18:23 ` [PATCH v2] " Vadim Bendebury
@ 2014-09-04 20:37 ` Vadim Bendebury
2014-09-04 21:13 ` [PATCH v4] " Vadim Bendebury
3 siblings, 0 replies; 7+ messages in thread
From: Vadim Bendebury @ 2014-09-04 20:37 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm, Vadim Bendebury, Andy Whitcroft, Joe Perches
This script is used by many other projects, and in some of them the
requirement of at least 4 line long description for all Kconfig items
is excessive. This patch adds a command line option to control the
required minimum length.
Tested running this script over a patch including a two line config
description. The script generated a warning when invoked as is, and
did not generate it when invoked with --min-conf-desc-length=2.
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
---
Changes in v3:
- fixed the indentation problem
scripts/checkpatch.pl | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index b385bcb..aa111e5 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -43,6 +43,7 @@ my $configuration_file = ".checkpatch.conf";
my $max_line_length = 80;
my $ignore_perl_version = 0;
my $minimum_perl_version = 5.10.0;
+my $min_conf_desc_length = 4;
sub help {
my ($exitcode) = @_;
@@ -63,6 +64,7 @@ Options:
--types TYPE(,TYPE2...) show only these comma separated message types
--ignore TYPE(,TYPE2...) ignore various comma separated message types
--max-line-length=n set the maximum line length, if exceeded, warn
+ --min-conf-desc-length=n set the min description length, if shorter, warn
--show-types show the message "types" in the output
--root=PATH PATH to the kernel tree root
--no-summary suppress the per-file summary
@@ -131,6 +133,7 @@ GetOptions(
'types=s' => \@use,
'show-types!' => \$show_types,
'max-line-length=i' => \$max_line_length,
+ 'min-conf-desc-length=i' => \$min_conf_desc_length,
'root=s' => \$root,
'summary!' => \$summary,
'mailback!' => \$mailback,
@@ -2280,8 +2283,10 @@ sub process {
}
$length++;
}
- WARN("CONFIG_DESCRIPTION",
- "please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($is_start && $is_end && $length < 4);
+ if ($is_start && $is_end && $length < $min_conf_desc_length) {
+ WARN("CONFIG_DESCRIPTION",
+ "please write a paragraph that describes the config symbol fully\n" . $herecurr)
+ }
#print "is_start<$is_start> is_end<$is_end> length<$length>\n";
}
--
2.1.0.rc2.206.gedb03e5
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v4] checkpatch: allow optional shorter config descriptions
2014-09-03 16:32 [PATCH] checkpatch: allow optional shorter config descriptions Vadim Bendebury
` (2 preceding siblings ...)
2014-09-04 20:37 ` [PATCH v3] " Vadim Bendebury
@ 2014-09-04 21:13 ` Vadim Bendebury
2014-09-04 21:16 ` Joe Perches
3 siblings, 1 reply; 7+ messages in thread
From: Vadim Bendebury @ 2014-09-04 21:13 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm, Vadim Bendebury, Andy Whitcroft, Joe Perches
This script is used by many other projects, and in some of them the
requirement of at least 4 line long description for all Kconfig items
is excessive. This patch adds a command line option to control the
required minimum length.
Tested running this script over a patch including a two line config
description. The script generated a warning when invoked as is, and
did not generate it when invoked with --min-conf-desc-length=2.
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
---
Changes in v4:
- added the missing trailing semicolon. Re-tested to verify that it
still works as expected.
Changes in v3:
- fixed the indentation problem
Changes in v2:
- modified the condition check as requested
scripts/checkpatch.pl | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index b385bcb..17003d6 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -43,6 +43,7 @@ my $configuration_file = ".checkpatch.conf";
my $max_line_length = 80;
my $ignore_perl_version = 0;
my $minimum_perl_version = 5.10.0;
+my $min_conf_desc_length = 4;
sub help {
my ($exitcode) = @_;
@@ -63,6 +64,7 @@ Options:
--types TYPE(,TYPE2...) show only these comma separated message types
--ignore TYPE(,TYPE2...) ignore various comma separated message types
--max-line-length=n set the maximum line length, if exceeded, warn
+ --min-conf-desc-length=n set the min description length, if shorter, warn
--show-types show the message "types" in the output
--root=PATH PATH to the kernel tree root
--no-summary suppress the per-file summary
@@ -131,6 +133,7 @@ GetOptions(
'types=s' => \@use,
'show-types!' => \$show_types,
'max-line-length=i' => \$max_line_length,
+ 'min-conf-desc-length=i' => \$min_conf_desc_length,
'root=s' => \$root,
'summary!' => \$summary,
'mailback!' => \$mailback,
@@ -2280,8 +2283,10 @@ sub process {
}
$length++;
}
- WARN("CONFIG_DESCRIPTION",
- "please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($is_start && $is_end && $length < 4);
+ if ($is_start && $is_end && $length < $min_conf_desc_length) {
+ WARN("CONFIG_DESCRIPTION",
+ "please write a paragraph that describes the config symbol fully\n" . $herecurr);
+ }
#print "is_start<$is_start> is_end<$is_end> length<$length>\n";
}
--
2.1.0.rc2.206.gedb03e5
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v4] checkpatch: allow optional shorter config descriptions
2014-09-04 21:13 ` [PATCH v4] " Vadim Bendebury
@ 2014-09-04 21:16 ` Joe Perches
0 siblings, 0 replies; 7+ messages in thread
From: Joe Perches @ 2014-09-04 21:16 UTC (permalink / raw)
To: Vadim Bendebury; +Cc: linux-kernel, akpm, Andy Whitcroft
On Thu, 2014-09-04 at 14:13 -0700, Vadim Bendebury wrote:
> This script is used by many other projects, and in some of them the
> requirement of at least 4 line long description for all Kconfig items
> is excessive. This patch adds a command line option to control the
> required minimum length.
>
> Tested running this script over a patch including a two line config
> description. The script generated a warning when invoked as is, and
> did not generate it when invoked with --min-conf-desc-length=2.
>
> Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
> ---
>
> Changes in v4:
> - added the missing trailing semicolon. Re-tested to verify that it
> still works as expected.
Acked-by: Joe Perches <joe@perches.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-09-04 21:16 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-03 16:32 [PATCH] checkpatch: allow optional shorter config descriptions Vadim Bendebury
2014-09-04 9:18 ` Joe Perches
2014-09-04 18:23 ` [PATCH v2] " Vadim Bendebury
2014-09-04 19:27 ` Joe Perches
2014-09-04 20:37 ` [PATCH v3] " Vadim Bendebury
2014-09-04 21:13 ` [PATCH v4] " Vadim Bendebury
2014-09-04 21:16 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®