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:
Jochen Eisinger 2016-03-07 09:06:23 +01:00
parent 8c09ccf840
commit 9dd8dbb1f7

3
cpplint/cpplint.py vendored
View File

@ -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.