MCPcopy Create free account
hub / github.com/apache/mesos / CanonicalizeAlphabeticalOrder

Method CanonicalizeAlphabeticalOrder

support/cpplint.py:777–790  ·  view source on GitHub ↗

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. - lowercase everything, just in case. Args: header_path: Path to be canonicalized. Retur

(self, header_path)

Source from the content-addressed store, hash-verified

775 self._last_header = header_path
776
777 def CanonicalizeAlphabeticalOrder(self, header_path):
778 """Returns a path canonicalized for alphabetical comparison.
779
780 - replaces "-" with "_" so they both cmp the same.
781 - removes '-inl' since we don't require them to be after the main header.
782 - lowercase everything, just in case.
783
784 Args:
785 header_path: Path to be canonicalized.
786
787 Returns:
788 Canonicalized path.
789 """
790 return header_path.replace('-inl.h', '.h').replace('-', '_').lower()
791
792 def IsInAlphabeticalOrder(self, clean_lines, linenum, header_path):
793 """Check if a header is in alphabetical order with the previous header.

Callers 1

CheckIncludeLineFunction · 0.80

Calls 1

lowerMethod · 0.45

Tested by

no test coverage detected