mirror of
https://github.com/google/styleguide.git
synced 2024-03-22 13:11:43 +08:00
Don't replace - with _ in header names prior to sorting.
The styleguide doesn't have this rule and it conflicts with what clang-format does.
This commit is contained in:
parent
8c09ccf840
commit
9dd8dbb1f7
3
cpplint/cpplint.py
vendored
3
cpplint/cpplint.py
vendored
|
@ -667,7 +667,6 @@ class _IncludeState(object):
|
||||||
def CanonicalizeAlphabeticalOrder(self, header_path):
|
def CanonicalizeAlphabeticalOrder(self, header_path):
|
||||||
"""Returns a path canonicalized for alphabetical comparison.
|
"""Returns a path canonicalized for alphabetical comparison.
|
||||||
|
|
||||||
- replaces "-" with "_" so they both cmp the same.
|
|
||||||
- removes '-inl' since we don't require them to be after the main header.
|
- removes '-inl' since we don't require them to be after the main header.
|
||||||
- lowercase everything, just in case.
|
- lowercase everything, just in case.
|
||||||
|
|
||||||
|
@ -677,7 +676,7 @@ class _IncludeState(object):
|
||||||
Returns:
|
Returns:
|
||||||
Canonicalized path.
|
Canonicalized path.
|
||||||
"""
|
"""
|
||||||
return header_path.replace('-inl.h', '.h').replace('-', '_').lower()
|
return header_path.replace('-inl.h', '.h').lower()
|
||||||
|
|
||||||
def IsInAlphabeticalOrder(self, clean_lines, linenum, header_path):
|
def IsInAlphabeticalOrder(self, clean_lines, linenum, header_path):
|
||||||
"""Check if a header is in alphabetical order with the previous header.
|
"""Check if a header is in alphabetical order with the previous header.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user