Skip to content

Commit

Permalink
Allow skipping paths in sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopgrassi committed Sep 10, 2024
1 parent 7d3c03f commit c7a1f5c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions build/scripts/sanitycheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,21 @@
CRLF = b'\r\n'
LF = b'\n'

# Add paths to exclude from sanity checks here
exclude_folders = [
"src/OpenTelemetry.SemanticConventions"
]
# Normalize paths so they work in windows/unix
exclude_folders = [os.path.normpath(folder) for folder in exclude_folders]

def sanitycheck(pattern, allow_utf8 = False, allow_eol = (CRLF, LF), indent = 1):
error_count = 0

for filename in glob.glob(pattern, recursive=True):
if not os.path.isfile(filename):
continue
if any(filename.startswith(exclude_folder) for exclude_folder in exclude_folders):
continue
with open(filename, 'rb') as file:
content = file.read()
error = []
Expand Down

0 comments on commit c7a1f5c

Please sign in to comment.