We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 85e8451 commit d945452Copy full SHA for d945452
scripts/cpplint.py
@@ -1971,8 +1971,13 @@ def GetHeaderGuardCPPVariable(filename):
1971
1972
fileinfo = FileInfo(filename)
1973
file_path_from_root = fileinfo.RepositoryName()
1974
- # Remove first path component
1975
- offset=len(file_path_from_root.split(os.path.sep)[0])+1
+ # Remove up to including `src` component
+ path_components = file_path_from_root.split(os.path.sep)
1976
+ offset = 0
1977
+ for component in path_components:
1978
+ offset += len(component) + 1
1979
+ if component == 'src' or component == 'unit':
1980
+ break
1981
file_path_from_root = 'CPROVER_' + file_path_from_root[offset:]
1982
if _root:
1983
suffix = os.sep
0 commit comments