mirror of
https://github.com/davidhalter/parso.git
synced 2026-08-13 19:41:03 +08:00
Add some newlines to avoid issues in other files.
This commit is contained in:
@@ -27,12 +27,14 @@ class TestP4Poller(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
if True:
|
if True:
|
||||||
#: E101:0 E101+1:0
|
#: E101:0 E101+1:0
|
||||||
foo(1,
|
foo(1,
|
||||||
2)
|
2)
|
||||||
|
|
||||||
|
|
||||||
def test_keys(self):
|
def test_keys(self):
|
||||||
"""areas.json - All regions are accounted for."""
|
"""areas.json - All regions are accounted for."""
|
||||||
expected = set([
|
expected = set([
|
||||||
@@ -41,6 +43,8 @@ def test_keys(self):
|
|||||||
#: E101:0
|
#: E101:0
|
||||||
u'V\xe4sterbotten',
|
u'V\xe4sterbotten',
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
if True:
|
if True:
|
||||||
print("""
|
print("""
|
||||||
tab at start of this line
|
tab at start of this line
|
||||||
|
|||||||
@@ -38,11 +38,14 @@ if start[1] > end_col and not (
|
|||||||
return (0, "E121 continuation line over-"
|
return (0, "E121 continuation line over-"
|
||||||
"indented for visual indent")
|
"indented for visual indent")
|
||||||
|
|
||||||
|
|
||||||
#: E101+3
|
#: E101+3
|
||||||
def long_function_name(
|
def long_function_name(
|
||||||
var_one, var_two, var_three,
|
var_one, var_two, var_three,
|
||||||
var_four):
|
var_four):
|
||||||
print(var_one)
|
print(var_one)
|
||||||
|
|
||||||
|
|
||||||
#: E101+2
|
#: E101+2
|
||||||
if ((row < 0 or self.moduleCount <= row or
|
if ((row < 0 or self.moduleCount <= row or
|
||||||
col < 0 or self.moduleCount <= col)):
|
col < 0 or self.moduleCount <= col)):
|
||||||
@@ -119,6 +122,8 @@ if True:
|
|||||||
foo(
|
foo(
|
||||||
1,
|
1,
|
||||||
2)
|
2)
|
||||||
|
|
||||||
|
|
||||||
#: E101+1 E101+2 E101+3 E101+4 E101+5
|
#: E101+1 E101+2 E101+3 E101+4 E101+5
|
||||||
def test_keys(self):
|
def test_keys(self):
|
||||||
"""areas.json - All regions are accounted for."""
|
"""areas.json - All regions are accounted for."""
|
||||||
@@ -126,6 +131,8 @@ def test_keys(self):
|
|||||||
u'Norrbotten',
|
u'Norrbotten',
|
||||||
u'V\xe4sterbotten',
|
u'V\xe4sterbotten',
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
#: E101+1
|
#: E101+1
|
||||||
x = [
|
x = [
|
||||||
'abc'
|
'abc'
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ mimetype = 'application/x-directory'
|
|||||||
# 'httpd/unix-directory'
|
# 'httpd/unix-directory'
|
||||||
create_date = False
|
create_date = False
|
||||||
|
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
# foo
|
# foo
|
||||||
#: E111:8
|
#: E111:8
|
||||||
@@ -46,6 +47,8 @@ def start(self):
|
|||||||
#: E111:2
|
#: E111:2
|
||||||
# Also wrongly indented.
|
# Also wrongly indented.
|
||||||
# Indent is correct.
|
# Indent is correct.
|
||||||
|
|
||||||
|
|
||||||
def start(self): # Correct comment
|
def start(self): # Correct comment
|
||||||
if True:
|
if True:
|
||||||
#: E111:0
|
#: E111:0
|
||||||
|
|||||||
@@ -100,8 +100,11 @@ x = x / 2-1
|
|||||||
hypot2 = x*x + y*y
|
hypot2 = x*x + y*y
|
||||||
c = (a + b)*(a - b)
|
c = (a + b)*(a - b)
|
||||||
|
|
||||||
|
|
||||||
def halves(n):
|
def halves(n):
|
||||||
return (i//2 for i in range(n))
|
return (i//2 for i in range(n))
|
||||||
|
|
||||||
|
|
||||||
#: E227:11 E227:13
|
#: E227:11 E227:13
|
||||||
_1kB = _1MB>>10
|
_1kB = _1MB>>10
|
||||||
#: E227:11 E227:13
|
#: E227:11 E227:13
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
def foo(bar = False):
|
def foo(bar = False):
|
||||||
'''Test function with an error in declaration'''
|
'''Test function with an error in declaration'''
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
#: E251:8
|
#: E251:8
|
||||||
foo(bar= True)
|
foo(bar= True)
|
||||||
#: E251:7
|
#: E251:7
|
||||||
@@ -33,24 +35,30 @@ foo(bar=(1 <= 1))
|
|||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
d[type(None)] = _deepcopy_atomic
|
d[type(None)] = _deepcopy_atomic
|
||||||
|
|
||||||
|
|
||||||
# Annotated Function Definitions
|
# Annotated Function Definitions
|
||||||
# Okay
|
# Okay
|
||||||
def munge(input: AnyStr, sep: AnyStr = None, limit=1000,
|
def munge(input: AnyStr, sep: AnyStr = None, limit=1000,
|
||||||
extra: Union[str, dict] = None) -> AnyStr:
|
extra: Union[str, dict] = None) -> AnyStr:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
# Okay
|
# Okay
|
||||||
async def add(a: int = 0, b: int = 0) -> int:
|
async def add(a: int = 0, b: int = 0) -> int:
|
||||||
return a + b
|
return a + b
|
||||||
|
|
||||||
|
|
||||||
# Previously E251 four times
|
# Previously E251 four times
|
||||||
#: E221:5
|
#: E221:5
|
||||||
async def add(a: int = 0, b: int = 0) -> int:
|
async def add(a: int = 0, b: int = 0) -> int:
|
||||||
return a + b
|
return a + b
|
||||||
|
|
||||||
|
|
||||||
#: E225:24 E225:26
|
#: E225:24 E225:26
|
||||||
def x(b: tuple = (1, 2))->int:
|
def x(b: tuple = (1, 2))->int:
|
||||||
return a + b
|
return a + b
|
||||||
|
|
||||||
|
|
||||||
#: E252:11 E252:12 E231:8
|
#: E252:11 E252:12 E231:8
|
||||||
def b(a:int=1):
|
def b(a:int=1):
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -2,10 +2,14 @@
|
|||||||
# 情
|
# 情
|
||||||
#: W291:5
|
#: W291:5
|
||||||
print
|
print
|
||||||
|
|
||||||
|
|
||||||
#: W291+1
|
#: W291+1
|
||||||
class Foo(object):
|
class Foo(object):
|
||||||
|
|
||||||
bang = 12
|
bang = 12
|
||||||
|
|
||||||
|
|
||||||
#: W291+1:34
|
#: W291+1:34
|
||||||
'''multiline
|
'''multiline
|
||||||
string with trailing whitespace'''
|
string with trailing whitespace'''
|
||||||
|
|||||||
Reference in New Issue
Block a user