Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
smspillaz committed Mar 3, 2016
1 parent 7cdec1a commit e583feb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 24 deletions.
9 changes: 0 additions & 9 deletions cmakeast/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ def _lookup_enum_in_ns(namespace, value):
# __repr__ and print out a human-readable type name
class Word(namedtuple("Word", # suppress(R0903)
"type contents line col index")):

"""A word-type node."""

def __repr__(self):
Expand All @@ -118,7 +117,6 @@ def __repr__(self):
# __repr__ and print out a human-readable type name
class Token(namedtuple("Token", # suppress(R0903)
"type content line col")):

"""An immutable record representing a token."""

def __repr__(self):
Expand All @@ -140,7 +138,6 @@ def __repr__(self):
# enums of different types. Since we could be analyzing
# quite a lot of code, performance is more important than safety here.
class WordType(object): # suppress(R0903,too-few-public-methods)

"""A class with instance variables for word types."""

String = 0
Expand All @@ -151,7 +148,6 @@ class WordType(object): # suppress(R0903,too-few-public-methods)


class TokenType(object): # suppress(R0903,too-few-public-methods)

"""A class with instance variables for token types."""

QuotedLiteral = 0
Expand Down Expand Up @@ -537,7 +533,6 @@ def _is_really_comment(tokens, index):


class _CommentedLineRecorder(object):

"""From the beginning of a comment to the end of the line."""

def __init__(self, begin, line):
Expand Down Expand Up @@ -617,7 +612,6 @@ def _paste_tokens_line_by_line(tokens, token_type, begin, end):


class _RSTCommentBlockRecorder(object):

"""From beginning of RST comment block to end of block."""

def __init__(self, begin, begin_line):
Expand Down Expand Up @@ -661,7 +655,6 @@ def consume_token(self, tokens, index, tokens_len):


class _InlineRSTRecorder(object):

"""From beginning of inline RST to end of inline RST."""

def __init__(self, begin):
Expand Down Expand Up @@ -691,7 +684,6 @@ def consume_token(self, tokens, index, tokens_len):


class _MultilineStringRecorder(object):

"""From the beginning of a begin_quoted_literal to end_quoted_literal."""

def __init__(self, begin, quote_type):
Expand Down Expand Up @@ -784,7 +776,6 @@ def consume_token(self, tokens, index, tokens_len):


class _EdgeCaseStrayParens(object): # suppress(R0903,too-few-public-methods)

"""Stateful function detecting stray comments."""

def __init__(self):
Expand Down
14 changes: 2 additions & 12 deletions test/test_ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def parse_for_word(string):


class TestRepresentations(TestCase):

"""__repr__ function on overridden named tuples."""

def test_repr_word(self):
Expand All @@ -41,7 +40,6 @@ def test_repr_token(self):


class TestTokenizer(TestCase):

"""Test case for tokenization functions."""

@parameterized.expand([
Expand Down Expand Up @@ -80,7 +78,6 @@ def test_detect_end_of_rst(self):


class TestParseGeneral(TestCase):

"""Thing common to all parses."""

@parameterized.expand([
Expand Down Expand Up @@ -117,7 +114,6 @@ def test_parse_arg_for_col(self, col, statement):


class TestParseWord(TestCase):

"""Test case for parsing individual arguments."""

def test_parse_single_word(self):
Expand Down Expand Up @@ -250,7 +246,6 @@ def test_parse_num_lit_type(self, num):


class TestParseFunctionCall(TestCase):

"""Test case for parsing function calls."""

def test_parse_function_call(self):
Expand All @@ -276,8 +271,8 @@ def test_function_call_args(self, contents):
ast.Word))


class TestParseBodyStatement(TestCase): # suppress(R0903)

# suppress(R0903,too-few-public-methods)
class TestParseBodyStatement(TestCase):
"""Test parsing header/body statements generally."""

def test_body_syntax_error(self): # suppress(no-self-use)
Expand All @@ -287,7 +282,6 @@ def test_body_syntax_error(self): # suppress(no-self-use)


class TestParseForeachStatement(TestCase):

"""Test case for parsing foreach statements."""

foreach_statement = """
Expand Down Expand Up @@ -326,7 +320,6 @@ def test_foreach_footer_name(self):


class TestParseWhileStatement(TestCase):

"""Test case for parsing while statements."""

while_statement = """
Expand Down Expand Up @@ -365,7 +358,6 @@ def test_while_footer_name(self):


class TestParseFunctionDefintion(TestCase):

"""Test case for parsing function definitions."""

function_definition = """
Expand Down Expand Up @@ -404,7 +396,6 @@ def test_function_footer_name(self):


class TestParseMacroDefintion(TestCase):

"""Test case for parsing macro definitions."""

macro_definition = """
Expand Down Expand Up @@ -443,7 +434,6 @@ def test_macro_footer_name(self):


class TestParseIfBlock(TestCase):

"""Test case for passing if, else, else-if blocks."""

if_else_if_block = """
Expand Down
1 change: 0 additions & 1 deletion test/test_ast_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def _ast_listener(name, node, depth):


class TestVisitASTRecursive(TestCase):

"""Test fixture for ast_visitor.recurse."""

@parameterized.expand([
Expand Down
4 changes: 2 additions & 2 deletions test/test_print_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ def _format_filename_doc(func, num, params):
return func.__doc__.format(params[0][0][prefix:])


class TestPrintAST(testtools.TestCase): # suppress(R0903)

# suppress(R0903,too-few-public-methods)
class TestPrintAST(testtools.TestCase):
"""Smoke tests for printing the AST."""

# pylint can get confused if we don't have an up-to-date
Expand Down

0 comments on commit e583feb

Please sign in to comment.