fix linting
This commit is contained in:
parent
daa64e21f6
commit
d068ff3afb
3 changed files with 11 additions and 11 deletions
|
@ -129,7 +129,7 @@ These individual tutorials expand on topics discussed in the guide above.
|
|||
* [Menu](api/menu.md)
|
||||
* [MenuItem](api/menu-item.md)
|
||||
* [net](api/net.md)
|
||||
* [netLog](api/netLog.md)
|
||||
* [netLog](api/net-log.md)
|
||||
* [powerMonitor](api/power-monitor.md)
|
||||
* [powerSaveBlocker](api/power-save-blocker.md)
|
||||
* [protocol](api/protocol.md)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# API Contract
|
||||
|
||||
Breaking changes will be documented here, and deprecation warnings added to JS code where possible, at least [one major version](electron-versioning.md#semver) before the change is made.
|
||||
Breaking changes will be documented here, and deprecation warnings added to JS code where possible, at least [one major version](../tutorial/electron-versioning.md#semver) before the change is made.
|
||||
|
||||
# `FIXME` comments
|
||||
|
||||
|
|
|
@ -223,15 +223,15 @@ def SubString(lines, start, end):
|
|||
return ''.join(result_lines)
|
||||
|
||||
|
||||
def StripMetaComments(str):
|
||||
def StripMetaComments(_str):
|
||||
"""Strip meta comments from each line in the given string."""
|
||||
|
||||
# First, completely remove lines containing nothing but a meta
|
||||
# comment, including the trailing \n.
|
||||
str = re.sub(r'^\s*\$\$.*\n', '', str)
|
||||
_str = re.sub(r'^\s*\$\$.*\n', '', _str)
|
||||
|
||||
# Then, remove meta comments from contentful lines.
|
||||
return re.sub(r'\s*\$\$.*', '', str)
|
||||
return re.sub(r'\s*\$\$.*', '', _str)
|
||||
|
||||
|
||||
def MakeToken(lines, start, end, token_type):
|
||||
|
@ -476,16 +476,16 @@ def ParseElseNode(tokens):
|
|||
def Pop(token_type=None):
|
||||
return PopToken(tokens, token_type)
|
||||
|
||||
next = PeekToken(tokens)
|
||||
_next = PeekToken(tokens)
|
||||
if not next:
|
||||
return None
|
||||
if next.token_type == '$else':
|
||||
if _next.token_type == '$else':
|
||||
Pop('$else')
|
||||
Pop('[[')
|
||||
code_node = ParseCodeNode(tokens)
|
||||
Pop(']]')
|
||||
return code_node
|
||||
elif next.token_type == '$elif':
|
||||
elif _next.token_type == '$elif':
|
||||
Pop('$elif')
|
||||
exp = Pop('code')
|
||||
Pop('[[')
|
||||
|
@ -493,7 +493,7 @@ def ParseElseNode(tokens):
|
|||
Pop(']]')
|
||||
inner_else_node = ParseElseNode(tokens)
|
||||
return CodeNode([IfNode(ParseExpNode(exp), code_node, inner_else_node)])
|
||||
elif not next.value.strip():
|
||||
elif not _next.value.strip():
|
||||
Pop('code')
|
||||
return ParseElseNode(tokens)
|
||||
else:
|
||||
|
@ -511,8 +511,8 @@ def ParseAtomicCodeNode(tokens):
|
|||
elif t == '$var':
|
||||
id_token = Pop('id')
|
||||
Pop('=')
|
||||
next = PeekToken(tokens)
|
||||
if next.token_type == 'exp':
|
||||
_next = PeekToken(tokens)
|
||||
if _next.token_type == 'exp':
|
||||
exp_token = Pop()
|
||||
return VarNode(id_token, ParseExpNode(exp_token))
|
||||
Pop('[[')
|
||||
|
|
Loading…
Reference in a new issue