Skip to content

Commit a9c4487

Browse files
committed
Merge commit 'ddccc0fbebaa011fa9c8dc71ebbdd35c1cfbfd12' into google-merge-2020-09-21
2 parents a736b22 + ddccc0f commit a9c4487

File tree

7 files changed

+1006
-259
lines changed

7 files changed

+1006
-259
lines changed

CODEOWNERS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax
2+
3+
csharp-style.md @jbcoe
4+
htmlcssguide.html @tonyruscoe
5+
javaguide.html @dimo414
6+
lispguide.xml @sfreilich
7+
pyguide.md @gpshead
8+
pylintrc @gpshead
9+
shellguide.md @dimo414 @eatnumber1 @vapier

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ style guidelines we use for Google code. If you are modifying a project that
168168
originated at Google, you may be pointed to this page to see the style guides
169169
that apply to that project.
170170

171-
This project holds the [C++ Style Guide][cpp], [Swift Style Guide][swift], [Objective-C Style Guide][objc],
171+
This project holds the [C++ Style Guide][cpp], [C# Style Guide][csharp],
172+
[Swift Style Guide][swift], [Objective-C Style Guide][objc],
172173
[Java Style Guide][java], [Python Style Guide][py], [R Style Guide][r],
173174
[Shell Style Guide][sh], [HTML/CSS Style Guide][htmlcss],
174175
[JavaScript Style Guide][js], [AngularJS Style Guide][angular],
@@ -192,6 +193,7 @@ The following Google style guides live outside of this project:
192193

193194

194195
[cpp]: https://google.github.io/styleguide/cppguide.html
196+
[csharp]: https://google.github.io/styleguide/csharp-style.html
195197
[swift]: https://google.github.io/swift/
196198
[objc]: objcguide.md
197199
[java]: https://google.github.io/styleguide/javaguide.html

cpplint/cpplint.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1810,7 +1810,7 @@ def CheckForCopyright(filename, lines, error):
18101810
"""Logs an error if no Copyright message appears at the top of the file."""
18111811

18121812
# We'll say it should occur by line 10. Don't forget there's a
1813-
# dummy line at the front.
1813+
# placeholder line at the front.
18141814
for line in xrange(1, min(len(lines), 11)):
18151815
if re.search(r'Copyright', lines[line], re.I): break
18161816
else: # means no copyright line was found
@@ -3947,9 +3947,9 @@ def CheckTrailingSemicolon(filename, clean_lines, linenum, error):
39473947

39483948
# Block bodies should not be followed by a semicolon. Due to C++11
39493949
# brace initialization, there are more places where semicolons are
3950-
# required than not, so we use a whitelist approach to check these
3951-
# rather than a blacklist. These are the places where "};" should
3952-
# be replaced by just "}":
3950+
# required than not, so we explicitly list the allowed rules rather
3951+
# than listing the disallowed ones. These are the places where "};"
3952+
# should be replaced by just "}":
39533953
# 1. Some flavor of block following closing parenthesis:
39543954
# for (;;) {};
39553955
# while (...) {};
@@ -4005,11 +4005,11 @@ def CheckTrailingSemicolon(filename, clean_lines, linenum, error):
40054005
# - INTERFACE_DEF
40064006
# - EXCLUSIVE_LOCKS_REQUIRED, SHARED_LOCKS_REQUIRED, LOCKS_EXCLUDED:
40074007
#
4008-
# We implement a whitelist of safe macros instead of a blacklist of
4008+
# We implement a list of safe macros instead of a list of
40094009
# unsafe macros, even though the latter appears less frequently in
40104010
# google code and would have been easier to implement. This is because
4011-
# the downside for getting the whitelist wrong means some extra
4012-
# semicolons, while the downside for getting the blacklist wrong
4011+
# the downside for getting the allowed checks wrong means some extra
4012+
# semicolons, while the downside for getting disallowed checks wrong
40134013
# would result in compile errors.
40144014
#
40154015
# In addition to macros, we also don't want to warn on
@@ -5209,20 +5209,20 @@ def CheckForNonConstReference(filename, clean_lines, linenum,
52095209
#
52105210
# We also accept & in static_assert, which looks like a function but
52115211
# it's actually a declaration expression.
5212-
whitelisted_functions = (r'(?:[sS]wap(?:<\w:+>)?|'
5212+
allowed_functions = (r'(?:[sS]wap(?:<\w:+>)?|'
52135213
r'operator\s*[<>][<>]|'
52145214
r'hash_append|'
52155215
r'static_assert|COMPILE_ASSERT'
52165216
r')\s*\(')
5217-
if Search(whitelisted_functions, line):
5217+
if Search(allowed_functions, line):
52185218
return
52195219
elif not Search(r'\S+\([^)]*$', line):
5220-
# Don't see a whitelisted function on this line. Actually we
5220+
# Don't see an allowed function on this line. Actually we
52215221
# didn't see any function name on this line, so this is likely a
52225222
# multi-line parameter list. Try a bit harder to catch this case.
52235223
for i in xrange(2):
52245224
if (linenum > i and
5225-
Search(whitelisted_functions, clean_lines.elided[linenum - i - 1])):
5225+
Search(allowed_functions, clean_lines.elided[linenum - i - 1])):
52265226
return
52275227

52285228
decls = ReplaceAll(r'{[^}]*}', ' ', line) # exclude function body

0 commit comments

Comments
 (0)