Skip to content

Commit 4791960

Browse files
authored
[repo] Allow skipping paths in sanity check script (open-telemetry#2060)
1 parent ce31331 commit 4791960

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

build/scripts/sanitycheck.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,21 @@
88
CRLF = b'\r\n'
99
LF = b'\n'
1010

11+
# Add paths to exclude from sanity checks here
12+
exclude_folders = [
13+
"src/OpenTelemetry.SemanticConventions/Attributes"
14+
]
15+
# Normalize paths so they work in windows/unix
16+
exclude_folders = [os.path.normpath(folder) for folder in exclude_folders]
17+
1118
def sanitycheck(pattern, allow_utf8 = False, allow_eol = (CRLF, LF), indent = 1):
1219
error_count = 0
1320

1421
for filename in glob.glob(pattern, recursive=True):
1522
if not os.path.isfile(filename):
1623
continue
24+
if any(filename.startswith(exclude_folder) for exclude_folder in exclude_folders):
25+
continue
1726
with open(filename, 'rb') as file:
1827
content = file.read()
1928
error = []

0 commit comments

Comments
 (0)