MCPcopy Index your code
hub / github.com/nodejs/node / CanonicalizeAlphabeticalOrder

Method CanonicalizeAlphabeticalOrder

tools/cpplint.py:1333–1346  ·  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 canon

(self, header_path)

Source from the content-addressed store, hash-verified

1331 self._last_header = header_path
1332
1333 def CanonicalizeAlphabeticalOrder(self, header_path):
1334 """Returns a path canonicalized for alphabetical comparison.
1335
1336 - replaces "-" with "_" so they both cmp the same.
1337 - removes '-inl' since we don't require them to be after the main header.
1338 - lowercase everything, just in case.
1339
1340 Args:
1341 header_path: Path to be canonicalized.
1342
1343 Returns:
1344 Canonicalized path.
1345 """
1346 return header_path.replace("-inl.h", ".h").replace("-", "_").lower()
1347
1348 def IsInAlphabeticalOrder(self, clean_lines, linenum, header_path):
1349 """Check if a header is in alphabetical order with the previous header.

Callers 1

CheckIncludeLineFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected