MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / find_expected_header_guard

Function find_expected_header_guard

scripts/check_header_guards.py:127–137  ·  view source on GitHub ↗
(filepath: str, prefix: str, add_extension: str, drop_outermost_subdir: str)

Source from the content-addressed store, hash-verified

125
126
127def find_expected_header_guard(filepath: str, prefix: str, add_extension: str, drop_outermost_subdir: str) -> str:
128 if drop_outermost_subdir:
129 arr : List[str] = filepath.split("/")
130 arr = arr[min(1, len(arr)-1):]
131 filepath = "/".join(arr)
132
133 if not add_extension:
134 filepath = ".".join(filepath.split(".")[:-1])
135
136 guard = filepath.replace("/", "_").replace(".", "_").upper() # snake case full path
137 return prefix + "_" + guard
138
139
140def skip_file(filepath: str, extensions: List[str], exclude: List[str], include: List[str]) -> bool:

Callers 1

Calls 1

upperMethod · 0.45

Tested by

no test coverage detected