mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2026-01-01 01:41:18 +01:00
Merge pull request #21430 from crasbe/pr/whitespace_pragma
dist/tools: add a leading whitespace check for `#pragma once` in the `headerguards` static test
This commit is contained in:
commit
ec94a3cd72
4
dist/tools/headerguards/headerguards.py
vendored
4
dist/tools/headerguards/headerguards.py
vendored
@ -50,6 +50,10 @@ def fix_headerguard(filename):
|
||||
for line in inlines:
|
||||
if line.startswith("#pragma once"):
|
||||
pragma_once_found += 1
|
||||
elif line.lstrip().startswith("#pragma once"):
|
||||
# check for lines that have leading whitespaces and add a correction
|
||||
pragma_once_found += 1
|
||||
line = "#pragma once\n"
|
||||
if guard_found == 0 and pragma_once_found == 0:
|
||||
if line.startswith("#ifndef"):
|
||||
guard_found += 1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user