Skip to content

GitHub Actions: Lint Python code for just for SyntaxErrors #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: lint

on: [push, pull_request]

permissions:
contents: read

jobs:
lint_python:
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v3
with: # Ignore all ruff rules except Python Syntax Errors
args: "check --ignore=ALL"
8 changes: 4 additions & 4 deletions openmp/runtime/tools/summarizeStats.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def draw_circle_frame(self, x0, y0, r):

frame_dict = {'polygon': draw_poly_frame, 'circle': draw_circle_frame}
if frame not in frame_dict:
raise ValueError, 'unknown value for `frame`: %s' % frame
raise ValueError('unknown value for `frame`: %s' % frame)

class RadarAxes(PolarAxes):
"""
Expand Down Expand Up @@ -143,7 +143,7 @@ def readFile(fname):
res["counters"] = readCounters(f)
return res
except (OSError, IOError):
print "Cannot open " + fname
print("Cannot open " + fname)
return None

def usefulValues(l):
Expand Down Expand Up @@ -235,7 +235,7 @@ def compPie(data):
compKeys[key] = data[key]
else:
nonCompKeys[key] = data[key]
print "comp keys:", compKeys, "\n\n non comp keys:", nonCompKeys
print("comp keys:", compKeys, "\n\n non comp keys:", nonCompKeys)
return [compKeys, nonCompKeys]

def drawMainPie(data, filebase, colors):
Expand Down Expand Up @@ -301,7 +301,7 @@ def main():
"""radar Charts finish here"""
plt.savefig(filebase+"_"+s+"_"+chartType, bbox_inches='tight')
elif s == 'timers':
print "overheads in "+filebase
print("overheads in "+filebase)
numThreads = tmp[s]['SampleCount']['Total_OMP_parallel']
for key in data.keys():
if key[0:5] == 'Total':
Expand Down
6 changes: 3 additions & 3 deletions polly/lib/External/isl/imath/tools/findthreshold.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ def compute_stats():
stats = compute_stats()
stats.sort(key=lambda s: s[3] / s[2])
for prec, thresh, trec, tnorm in stats:
print "%d\t%d\t%.3f\t%.3f\t%.4f" % (prec, thresh, trec, tnorm,
tnorm / trec)
print("%d\t%d\t%.3f\t%.3f\t%.4f" % (prec, thresh, trec, tnorm,
tnorm / trec))

print
print()

# Here there be dragons
2 changes: 1 addition & 1 deletion polly/utils/jscop2cloog.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def writeCloog(scop):
context = scop['context']
domains = getDomains(scop)
schedules = getSchedules(scop)
print template % (context, domains, schedules)
print(template % (context, domains, schedules))

def __main__():
description = 'Translate JSCoP into iscc input'
Expand Down
24 changes: 12 additions & 12 deletions polly/utils/pyscop/jscop2iscc.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ def printDomain(scop):
for statement in scop['statements']:
domain = domain.union(isl.USet(statement['domain']))

print "D :=",
print str(domain) + ";"
print("D :=", end=" ")
print(str(domain) + ";")

def printAccesses(scop):

Expand All @@ -21,8 +21,8 @@ def printAccesses(scop):
if access['kind'] == 'read':
read = read.union(isl.UMap(access['relation']))

print "R :=",
print str(read) + ";"
print("R :=", end=" ")
print(str(read) + ";")

write = isl.UMap('{}')

Expand All @@ -31,8 +31,8 @@ def printAccesses(scop):
if access['kind'] == 'write':
write = write.union(isl.UMap(access['relation']))

print "W :=",
print str(write) + ";"
print("W :=", end=" ")
print(str(write) + ";")

def printSchedule(scop):

Expand All @@ -41,8 +41,8 @@ def printSchedule(scop):
for statement in scop['statements']:
schedule = schedule.union(isl.UMap(statement['schedule']))

print "S :=",
print str(schedule) + ";"
print("S :=", end=" ")
print(str(schedule) + ";")

def __main__():
description = 'Translate JSCoP into iscc input'
Expand All @@ -58,10 +58,10 @@ def __main__():
printAccesses(scop)
printSchedule(scop)

print 'R := R * D;'
print 'W := W * D;'
print 'Dep := (last W before R under S)[0];'
print 'schedule D respecting Dep minimizing Dep;'
print('R := R * D;')
print('W := W * D;')
print('Dep := (last W before R under S)[0];')
print('schedule D respecting Dep minimizing Dep;')


__main__()
Expand Down