MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / CheckEnd

Method CheckEnd

steps/cpplint.py:2805–2833  ·  view source on GitHub ↗
(self, filename, clean_lines, linenum, error)

Source from the content-addressed store, hash-verified

2803 self.is_derived = True
2804
2805 def CheckEnd(self, filename, clean_lines, linenum, error):
2806 # If there is a DISALLOW macro, it should appear near the end of
2807 # the class.
2808 seen_last_thing_in_class = False
2809 for i in xrange(linenum - 1, self.starting_linenum, -1):
2810 match = Search(
2811 r'\b(DISALLOW_COPY_AND_ASSIGN|DISALLOW_IMPLICIT_CONSTRUCTORS)\(' +
2812 self.name + r'\)',
2813 clean_lines.elided[i])
2814 if match:
2815 if seen_last_thing_in_class:
2816 error(filename, i, 'readability/constructors', 3,
2817 match.group(1) + ' should be the last thing in the class')
2818 break
2819
2820 if not Match(r'^\s*$', clean_lines.elided[i]):
2821 seen_last_thing_in_class = True
2822
2823 # Check that closing brace is aligned with beginning of the class.
2824 # Only do this if the closing brace is indented by only whitespaces.
2825 # This means we will not check single-line class definitions.
2826 indent = Match(r'^( *)\}', clean_lines.elided[linenum])
2827 if indent and len(indent.group(1)) != self.class_indent:
2828 if self.is_struct:
2829 parent = 'struct ' + self.name
2830 else:
2831 parent = 'class ' + self.name
2832 error(filename, linenum, 'whitespace/indent', 3,
2833 'Closing brace should be aligned with beginning of %s' % parent)
2834
2835
2836class _NamespaceInfo(_BlockInfo):

Callers

nothing calls this directly

Calls 2

SearchFunction · 0.85
MatchFunction · 0.85

Tested by

no test coverage detected