Skip to content

Commit

Permalink
Fix flake8 lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
MikePopoloski committed Aug 4, 2022
1 parent 51d9e7d commit c4f4a4a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
max-line-length = 88
extend-ignore = E203,E501,F401,F403,F405
10 changes: 5 additions & 5 deletions pyslang/tests/test_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ def test_numerics():


def test_bag():
l = LexerOptions()
p = ParserOptions()
p.maxRecursionDepth = 4
b = Bag([l, p])
lo = LexerOptions()
po = ParserOptions()
po.maxRecursionDepth = 4
b = Bag([lo, po])
assert b.parserOptions.maxRecursionDepth == 4
assert b.compilationOptions == None
assert b.compilationOptions is None


testFile = """
Expand Down
10 changes: 5 additions & 5 deletions scripts/diagnostic_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def createsource(path, diags, groups):
static const flat_hash_map<DiagCode, std::tuple<string_view, string_view, DiagnosticSeverity, string_view>> data = {
"""

for k, v in sorted(diags.items()):
for _, v in sorted(diags.items()):
for d in sorted(v):
output += ' {{diag::{}, std::make_tuple("{}"sv, "{}"sv, DiagnosticSeverity::{}, "{}"sv)}},\n'.format(
d[1], d[1], d[2], d[0], d[3]
Expand All @@ -163,7 +163,7 @@ def createsource(path, diags, groups):
"""

optionMap = {}
for k, v in sorted(diags.items()):
for _, v in sorted(diags.items()):
for d in sorted(v):
name = d[3]
if not name:
Expand Down Expand Up @@ -240,7 +240,7 @@ def createsource(path, diags, groups):
static const DiagCode AllGeneratedCodes[] = {
"""

for k, v in sorted(diags.items()):
for _, v in sorted(diags.items()):
for d in sorted(v):
output += " diag::{},\n".format(d[1])

Expand Down Expand Up @@ -350,7 +350,7 @@ def createdocs(outDir, inpath, slangBin, diags, groups):
else:
groupMap[e] = set([g[0]])

for k, v in diags.items():
for _, v in diags.items():
for d in v:
if not d[3]:
continue
Expand Down Expand Up @@ -403,7 +403,7 @@ def createdocs(outDir, inpath, slangBin, diags, groups):
else:
opt = d[0]
lastOpt = opt
elemlist = ", ".join("@ref {}".format(s, s) for s in d[1])
elemlist = ", ".join("@ref {}".format(s) for s in d[1])

output += "\n@n\n@subsection {} -W{}\n".format(opt, opt)
output += "Controls {}.\n@n\n".format(elemlist)
Expand Down
6 changes: 3 additions & 3 deletions scripts/syntax_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ def generateSyntax(builddir, alltypes, kindmap):
"""
)

for k, v in sorted(kindmap.items()):
for k, _ in sorted(kindmap.items()):
cppf.write(' case SyntaxKind::{}: return "{}";\n'.format(k, k))

cppf.write(
Expand All @@ -527,7 +527,7 @@ def generateSyntax(builddir, alltypes, kindmap):
SyntaxKind::SeparatedList,
"""
)
for k, v in sorted(kindmap.items()):
for k, _ in sorted(kindmap.items()):
cppf.write(" SyntaxKind::{},\n".format(k))
cppf.write(
"""};
Expand Down Expand Up @@ -644,7 +644,7 @@ def generateSyntax(builddir, alltypes, kindmap):
"""
)

for k, v in sorted(kindmap.items()):
for k, _ in sorted(kindmap.items()):
outf.write(" {},\n".format(k))

outf.write(
Expand Down

0 comments on commit c4f4a4a

Please sign in to comment.