Skip to content

Commit

Permalink
[lint] solve linter and mypy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
apalala committed Oct 13, 2023
1 parent 82185fb commit b48b550
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[mypy]
python_version = 3.9
python_version = 3.12
ignore_missing_imports = True
exclude = parsers|docs|build|tmp
1 change: 0 additions & 1 deletion tatsu/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import sys

from tatsu.buffering import Buffer
from tatsu.parsing import Parser
from tatsu.parsing import tatsumasu
from tatsu.parsing import leftrec, nomemo, isname # noqa
Expand Down
1 change: 0 additions & 1 deletion tatsu/codegen/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,6 @@ def {name}(self, ast): # noqa
import sys
from tatsu.buffering import Buffer
from tatsu.parsing import Parser
from tatsu.parsing import tatsumasu
from tatsu.parsing import leftrec, nomemo, isname # noqa
Expand Down
2 changes: 1 addition & 1 deletion test/grammar/alerts_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

def test_alert_interpolation():
input = '42 69'
grammar = '''
grammar = r'''
start = a:number b: number i:^`"seen: {a}, {b}"` $ ;
number = /\d+/ ;
'''
Expand Down
6 changes: 3 additions & 3 deletions test/grammar/constants_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

def test_constant_interpolation():
input = '42 69'
grammar = '''
grammar = r'''
start = a:number b: number i:`"seen: {a}, {b}"` $ ;
number = /\d+/ ;
'''
Expand All @@ -14,7 +14,7 @@ def test_constant_interpolation():

def test_constant_interpolation_free():
input = '42 69'
grammar = '''
grammar = r'''
start = a:number b: number i:`seen: {a}, {b}` $ ;
number = /\d+/ ;
'''
Expand All @@ -23,7 +23,7 @@ def test_constant_interpolation_free():

def test_constant_interpolation_multiline():
input = '42 69'
grammar = '''
grammar = r'''
start = a:number b: number
i:```
seen:
Expand Down
4 changes: 2 additions & 2 deletions test/grammar/defines_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


def test_name_in_option():
grammar = '''
grammar = r'''
start = expr_range ;
expr_range =
Expand Down Expand Up @@ -41,7 +41,7 @@ def test_name_in_option():


def test_by_option():
grammar = '''
grammar = r'''
start = expr_range ;
expr_range =
Expand Down
2 changes: 1 addition & 1 deletion test/grammar/keyword_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def test_sparse_keywords(self):
self.assertTrue('"%s" is a reserved word' % k in str(e))

def test_ignorecase_keywords(self):
grammar = '''
grammar = r'''
@@ignorecase :: True
@@keyword :: if
Expand Down
6 changes: 3 additions & 3 deletions test/parser_equivalence_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"""
OUTPUT = {'number_of_dice': '1', 'sides': '3'}

GRAMMAR = """
GRAMMAR = r"""
start = expression $;
int = /-?\d+/ ;
Expand Down Expand Up @@ -82,7 +82,7 @@ def test_error_messages():

# @pytest.mark.skip('work in progress')
def test_name_checked():
grammar = '''
grammar = r'''
@@grammar :: Test
@@ignorecase :: True
@@keyword :: if
Expand Down Expand Up @@ -123,7 +123,7 @@ def test_first_rule():


def test_dynamic_compiled_ast():
grammar = '''
grammar = r'''
test::Test = 'TEST' ['A' a:number] ['B' b:number] ;
number::int = /\d+/ ;
'''
Expand Down

0 comments on commit b48b550

Please sign in to comment.