check_GNU_style.py: Skip .md square bracket linting

Message ID 20230912185436.314306-1-patrick@rivosinc.com
State Accepted
Headers
Series check_GNU_style.py: Skip .md square bracket linting |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Patrick O'Neill Sept. 12, 2023, 6:54 p.m. UTC
  This testcase causes lots of false-positives for machine description files.

contrib/ChangeLog:

	* check_GNU_style_lib.py: Skip machine description file bracket linting.

Signed-off-by: Patrick O'Neill <patrick@rivosinc.com>
---
 contrib/check_GNU_style_lib.py | 3 +++
 1 file changed, 3 insertions(+)

--
2.34.1
  

Comments

Jeff Law Sept. 29, 2023, 7:05 p.m. UTC | #1
On 9/12/23 12:54, Patrick O'Neill wrote:
> This testcase causes lots of false-positives for machine description files.
> 
> contrib/ChangeLog:
> 
> 	* check_GNU_style_lib.py: Skip machine description file bracket linting.
OK.  We probably need a completely separate checker for for .md files.


jeff
  
Patrick O'Neill Sept. 29, 2023, 9:14 p.m. UTC | #2
On 9/29/23 12:05, Jeff Law wrote:
>
>
> On 9/12/23 12:54, Patrick O'Neill wrote:
>> This testcase causes lots of false-positives for machine description 
>> files.
>>
>> contrib/ChangeLog:
>>
>>     * check_GNU_style_lib.py: Skip machine description file bracket 
>> linting.
> OK.  We probably need a completely separate checker for for .md files.
>
>
> jeff

Committed.

Thanks!
  

Patch

diff --git a/contrib/check_GNU_style_lib.py b/contrib/check_GNU_style_lib.py
index 94a742941cf..5096b1333f3 100755
--- a/contrib/check_GNU_style_lib.py
+++ b/contrib/check_GNU_style_lib.py
@@ -182,6 +182,9 @@  class SquareBracketCheck:
         self.re = re.compile('\w\s+(\[)')

     def check(self, filename, lineno, line):
+        if filename.endswith('.md'):
+            return None
+
         m = self.re.search(line)
         if m != None:
             return CheckError(filename, lineno,