Julius Werner has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31746
Change subject: lint/kconfig: Fix check for IS_ENABLED(XXX) where someone forgot CONFIG_ ......................................................................
lint/kconfig: Fix check for IS_ENABLED(XXX) where someone forgot CONFIG_
This is a great check, but unfortunately it's currently not effective because most uses of IS_ENABLED() do not have whitespace in front of them (they're mostly used as part of an if (IS_ENABLED(...)) condition). This patch makes the linter a little more generous in what it considers in scope to avoid these false negatives in the future.
Change-Id: I2296410c73cd6e918465c90db33e782936bec0f9 Signed-off-by: Julius Werner jwerner@chromium.org --- M util/lint/kconfig_lint 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/46/31746/1
diff --git a/util/lint/kconfig_lint b/util/lint/kconfig_lint index eddd8de..e2d462f6 100755 --- a/util/lint/kconfig_lint +++ b/util/lint/kconfig_lint @@ -236,11 +236,11 @@ my @collected_is_enabled; if ($dont_use_git_grep) { @collected_is_enabled = - `grep -Irn -- "[[:space:]]IS_ENABLED[[:space:]]*(.*)" | grep -v '$exclude_dirs_and_files' | grep -v "kconfig.h"`; + `grep -Irn -- "IS_ENABLED[[:space:]]*(.*)" | grep -v '$exclude_dirs_and_files' | grep -v "kconfig.h"`; } else { @collected_is_enabled = - `git grep -In -- "[[:space:]]IS_ENABLED[[:space:]]*(.*)" | grep -v '$exclude_dirs_and_files' | grep -v "kconfig.h"`; + `git grep -In -- "IS_ENABLED[[:space:]]*(.*)" | grep -v '$exclude_dirs_and_files' | grep -v "kconfig.h"`; }
while ( my $line = shift @collected_is_enabled ) {
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31746 )
Change subject: lint/kconfig: Fix check for IS_ENABLED(XXX) where someone forgot CONFIG_ ......................................................................
Patch Set 1: Code-Review+1
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31746 )
Change subject: lint/kconfig: Fix check for IS_ENABLED(XXX) where someone forgot CONFIG_ ......................................................................
Patch Set 1: Code-Review+2
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31746 )
Change subject: lint/kconfig: Fix check for IS_ENABLED(XXX) where someone forgot CONFIG_ ......................................................................
Patch Set 1: Code-Review+1
(1 comment)
https://review.coreboot.org/#/c/31746/1/util/lint/kconfig_lint File util/lint/kconfig_lint:
https://review.coreboot.org/#/c/31746/1/util/lint/kconfig_lint@a239 PS1, Line 239: "<" would do what the space was (I think) put in for: make sure that it's not tripping over VIS_ENABLED or something like that, just that < only ensures that the word ends there, matching no particular character but a non-alphanum to alphanum transition.
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31746 )
Change subject: lint/kconfig: Fix check for IS_ENABLED(XXX) where someone forgot CONFIG_ ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/#/c/31746/1/util/lint/kconfig_lint File util/lint/kconfig_lint:
https://review.coreboot.org/#/c/31746/1/util/lint/kconfig_lint@a239 PS1, Line 239:
"<" would do what the space was (I think) put in for: make sure that it's not tripping over VIS_ENA […]
Right... I first through grep regular expressions don't support that, but it turns out I just didn't do the escaping right. Will add.
Hello Paul Menzel, build bot (Jenkins), Nico Huber, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/31746
to look at the new patch set (#2).
Change subject: lint/kconfig: Fix check for IS_ENABLED(XXX) where someone forgot CONFIG_ ......................................................................
lint/kconfig: Fix check for IS_ENABLED(XXX) where someone forgot CONFIG_
This is a great check, but unfortunately it's currently not effective because most uses of IS_ENABLED() do not have whitespace in front of them (they're mostly used as part of an if (IS_ENABLED(...)) condition). This patch makes the linter a little more generous in what it considers in scope to avoid these false negatives in the future.
Change-Id: I2296410c73cd6e918465c90db33e782936bec0f9 Signed-off-by: Julius Werner jwerner@chromium.org --- M util/lint/kconfig_lint 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/46/31746/2
Hello Paul Menzel, build bot (Jenkins), Nico Huber, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/31746
to look at the new patch set (#3).
Change subject: lint/kconfig: Fix check for IS_ENABLED(XXX) where someone forgot CONFIG_ ......................................................................
lint/kconfig: Fix check for IS_ENABLED(XXX) where someone forgot CONFIG_
This is a great check, but unfortunately it's currently not effective because most uses of IS_ENABLED() do not have whitespace in front of them (they're mostly used as part of an if (IS_ENABLED(...)) condition). This patch makes the linter a little more generous in what it considers in scope to avoid these false negatives in the future.
Change-Id: I2296410c73cd6e918465c90db33e782936bec0f9 Signed-off-by: Julius Werner jwerner@chromium.org --- M util/lint/kconfig_lint 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/46/31746/3
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31746 )
Change subject: lint/kconfig: Fix check for IS_ENABLED(XXX) where someone forgot CONFIG_ ......................................................................
Patch Set 3: Code-Review+2
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31746 )
Change subject: lint/kconfig: Fix check for IS_ENABLED(XXX) where someone forgot CONFIG_ ......................................................................
Patch Set 3: Code-Review+2
(1 comment)
https://review.coreboot.org/#/c/31746/1/util/lint/kconfig_lint File util/lint/kconfig_lint:
https://review.coreboot.org/#/c/31746/1/util/lint/kconfig_lint@a239 PS1, Line 239:
Right... […]
IIRC, it's not covered by POSIX basic regexp. But that doesn't matter. Even if somebody runs this with a grep that doesn't know <, it would just be a false negative as before.
Julius Werner has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/31746 )
Change subject: lint/kconfig: Fix check for IS_ENABLED(XXX) where someone forgot CONFIG_ ......................................................................
lint/kconfig: Fix check for IS_ENABLED(XXX) where someone forgot CONFIG_
This is a great check, but unfortunately it's currently not effective because most uses of IS_ENABLED() do not have whitespace in front of them (they're mostly used as part of an if (IS_ENABLED(...)) condition). This patch makes the linter a little more generous in what it considers in scope to avoid these false negatives in the future.
Change-Id: I2296410c73cd6e918465c90db33e782936bec0f9 Signed-off-by: Julius Werner jwerner@chromium.org Reviewed-on: https://review.coreboot.org/c/coreboot/+/31746 Reviewed-by: Patrick Georgi pgeorgi@google.com Reviewed-by: Nico Huber nico.h@gmx.de Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M util/lint/kconfig_lint 1 file changed, 2 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Patrick Georgi: Looks good to me, approved Nico Huber: Looks good to me, approved
diff --git a/util/lint/kconfig_lint b/util/lint/kconfig_lint index eddd8de..dc01e71 100755 --- a/util/lint/kconfig_lint +++ b/util/lint/kconfig_lint @@ -236,11 +236,11 @@ my @collected_is_enabled; if ($dont_use_git_grep) { @collected_is_enabled = - `grep -Irn -- "[[:space:]]IS_ENABLED[[:space:]]*(.*)" | grep -v '$exclude_dirs_and_files' | grep -v "kconfig.h"`; + `grep -Irn -- "\<IS_ENABLED[[:space:]]*(.*)" | grep -v '$exclude_dirs_and_files' | grep -v "kconfig.h"`; } else { @collected_is_enabled = - `git grep -In -- "[[:space:]]IS_ENABLED[[:space:]]*(.*)" | grep -v '$exclude_dirs_and_files' | grep -v "kconfig.h"`; + `git grep -In -- "\<IS_ENABLED[[:space:]]*(.*)" | grep -v '$exclude_dirs_and_files' | grep -v "kconfig.h"`; }
while ( my $line = shift @collected_is_enabled ) {