Skip to content

Commit

Permalink
pragma once not allowd (#3842)
Browse files Browse the repository at this point in the history
Co-authored-by: Sophie <84560950+Sophie-Xie@users.noreply.github.com>
  • Loading branch information
jiayuehua and Sophie-Xie committed Jan 29, 2022
1 parent 5fae645 commit dd4ca69
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .linters/cpp/cpplint.py
Original file line number Diff line number Diff line change
Expand Up @@ -2130,9 +2130,11 @@ def CheckForHeaderGuard(filename, clean_lines, error):
if Search(r'//\s*NOLINT\(build/header_guard\)', i):
return

# Allow pragma once instead of header guards
# notallow pragma once
for i in raw_lines:
if Search(r'^\s*#pragma\s+once', i):
error(filename, 0, 'build/header_guard', 5,
'Pragma once not allowed, please use ifndef Instead')
return

cppvar = GetHeaderGuardCPPVariable(filename)
Expand Down

0 comments on commit dd4ca69

Please sign in to comment.