[1/2] devtools: support skipping forbid rule check

Message ID 20231004122753.3261337-1-jerinj@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [1/2] devtools: support skipping forbid rule check |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Jerin Jacob Kollanukkaran Oct. 4, 2023, 12:27 p.m. UTC
  From: Jerin Jacob <jerinj@marvell.com>

In some case, a set of files in directory may need to skip forbid
rules check.

Added an infrastructure to enable the same using SKIP_FILES variable.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
---
 devtools/check-forbidden-tokens.awk | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
  

Comments

Jerin Jacob Nov. 17, 2023, 4:34 a.m. UTC | #1
On Wed, Oct 4, 2023 at 11:56 PM <jerinj@marvell.com> wrote:
>
> From: Jerin Jacob <jerinj@marvell.com>
>
> In some case, a set of files in directory may need to skip forbid
> rules check.
>
> Added an infrastructure to enable the same using SKIP_FILES variable.
>
> Signed-off-by: Jerin Jacob <jerinj@marvell.com>

Ping for review

> ---
>  devtools/check-forbidden-tokens.awk | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/devtools/check-forbidden-tokens.awk b/devtools/check-forbidden-tokens.awk
> index 026844141c..90d3a64f8e 100755
> --- a/devtools/check-forbidden-tokens.awk
> +++ b/devtools/check-forbidden-tokens.awk
> @@ -58,8 +58,11 @@ BEGIN {
>         for (i in deny_folders) {
>                 re = "^\\+\\+\\+ b/" deny_folders[i];
>                 if ($0 ~ re) {
> -                       in_file = 1
> -                       last_file = $0
> +                       # Check only if the files are not part of SKIP_FILES
> +                       if (!(length(SKIP_FILES) && ($re ~ SKIP_FILES))) {
> +                               in_file = 1
> +                               last_file = $0
> +                       }
>                 }
>         }
>  }
> --
> 2.42.0
>
  

Patch

diff --git a/devtools/check-forbidden-tokens.awk b/devtools/check-forbidden-tokens.awk
index 026844141c..90d3a64f8e 100755
--- a/devtools/check-forbidden-tokens.awk
+++ b/devtools/check-forbidden-tokens.awk
@@ -58,8 +58,11 @@  BEGIN {
 	for (i in deny_folders) {
 		re = "^\\+\\+\\+ b/" deny_folders[i];
 		if ($0 ~ re) {
-			in_file = 1
-			last_file = $0
+			# Check only if the files are not part of SKIP_FILES
+			if (!(length(SKIP_FILES) && ($re ~ SKIP_FILES))) {
+				in_file = 1
+				last_file = $0
+			}
 		}
 	}
 }