Skip to content

Commit

Permalink
remove trailing semicolons from python files (chapel-lang#26075)
Browse files Browse the repository at this point in the history
This cleans up the syntax in our python files by removing the trailing
semicolons that sometimes find their way in.

TESTING:

- [x] paratest `[Summary: #Successes = 17657 | #Failures = 0 | #Futures
= 887]`
- [x] paratest w/gasnet `[Summary: #Successes = 17838 | #Failures = 0 |
#Futures = 896]`

[reviewed by @ShreyasKhandekar - thanks!]
  • Loading branch information
arezaii authored Oct 14, 2024
2 parents c83a770 + 593c438 commit 7249ca9
Show file tree
Hide file tree
Showing 46 changed files with 156 additions and 156 deletions.
2 changes: 1 addition & 1 deletion doc/rst/search_index_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def on_build_finish(app, exc):

# remove 'Search.setIndex(' as well as the trailing )
searchindex = remove_prefix(searchindex, 'Search.setIndex(')
searchindex = remove_suffix(searchindex, ')');
searchindex = remove_suffix(searchindex, ')')

# parse the result as a json object
index = json.loads(searchindex)
Expand Down
2 changes: 1 addition & 1 deletion doc/util/literate_chapel.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def push_line(line):
state = 'blockcomment'
if commentstarts > 0:
# reset indentation at the start of a block comment
#indentation = -1;
#indentation = -1
pass
elif line.startswith('//'):
state = 'linecomment'
Expand Down
2 changes: 1 addition & 1 deletion test/execflags/jhh/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def checkLauncherArg(prog, outputFile, outputContent=None, delete=False):
else:
fGood.write(content)
else:
fGood.write('Launcher argument missing: ' + arg);
fGood.write('Launcher argument missing: ' + arg)
if delete:
# Delete the output file. Its name isn't fixed and .cleanfiles doesn't do globbing.
os.unlink(outputFile)
2 changes: 1 addition & 1 deletion test/exercises/wavelet/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
ax[0].set_title("ecg signal")

# plot detail layers
fmin = 0;
fmin = 0
fmax = math.floor(len(coeffs) / 2**num_levels)
for i in range(0, num_levels):
idx = num_levels - i
Expand Down
2 changes: 1 addition & 1 deletion test/interop/python/multilocale/use_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
bar.foo()
x = 3
y = bar.takesAndReturns(x)
bar.threadring(1000, 98);
bar.threadring(1000, 98)
bar.chpl_cleanup()
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
checkExplicitLibname.foo()
x = 3
y = checkExplicitLibname.takesAndReturns(x)
checkExplicitLibname.threadring(1000, 98);
checkExplicitLibname.threadring(1000, 98)
checkExplicitLibname.chpl_cleanup()
2 changes: 1 addition & 1 deletion test/interop/python/multilocale/use_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
testing.foo()
x = 3
y = testing.takesAndReturns(x)
testing.threadring(1000, 98);
testing.threadring(1000, 98)
testing.chpl_cleanup()
2 changes: 1 addition & 1 deletion test/interop/python/noLibFlag/use_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
bar.foo()
x = 3
y = bar.takesAndReturns(x)
bar.threadring(1000, 98);
bar.threadring(1000, 98)
bar.chpl_cleanup()
2 changes: 1 addition & 1 deletion test/interop/python/noLibFlag/use_pythonCompile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
pythonCompile.foo()
x = 3
y = pythonCompile.takesAndReturns(x)
pythonCompile.threadring(1000, 98);
pythonCompile.threadring(1000, 98)
pythonCompile.chpl_cleanup()
2 changes: 1 addition & 1 deletion test/interop/python/use_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
bar.foo()
x = 3
y = bar.takesAndReturns(x)
bar.threadring(1000, 98);
bar.threadring(1000, 98)
bar.chpl_cleanup()
2 changes: 1 addition & 1 deletion test/interop/python/use_checkExplicitLibname.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
checkExplicitLibname.foo()
x = 3
y = checkExplicitLibname.takesAndReturns(x)
checkExplicitLibname.threadring(1000, 98);
checkExplicitLibname.threadring(1000, 98)
checkExplicitLibname.chpl_cleanup()
2 changes: 1 addition & 1 deletion test/interop/python/use_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
testing.foo()
x = 3
y = testing.takesAndReturns(x)
testing.threadring(1000, 98);
testing.threadring(1000, 98)
testing.chpl_cleanup()
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
else:
print("true")

lst = [];
lst = []
lst.append(enums_pb2.color.blue)
lst.append(enums_pb2.color.green)
if messageObj.c != lst:
Expand All @@ -29,7 +29,7 @@
else:
print("true")

lst = [];
lst = []
lst.append(messageObj.fruit.orange)
lst.append(messageObj.fruit.apple)
if messageObj.e != lst:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import enums_pb2

messageObj = enums_pb2.enumTest();
messageObj = enums_pb2.enumTest()

messageObj.a = enums_pb2.color.blue

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
messageObj = oneofs_pb2.Foo()

messageObj.co = oneofs_pb2.color.green
messageObj.name = b"chapel";
messageObj.name = b"chapel"

messageObj.mfield.a = 67
messageObj.ifield = 45
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,55 +6,55 @@
messageObj.ParseFromString(file.read())
file.close()

lst = [];
lst = []
lst.append(1)
lst.append(2445464)
if messageObj.ui64 != lst:
print("false")
else:
print("true")

lst = [];
lst = []
lst.append(1)
lst.append(24454)
if messageObj.ui32 != lst:
print("false")
else:
print("true")

lst = [];
lst = []
lst.append(-100)
lst.append(244540000000)
if messageObj.i64 != lst:
print("false")
else:
print("true")

lst = [];
lst.append(-500);
lst.append(2445489);
lst = []
lst.append(-500)
lst.append(2445489)
if messageObj.i32 != lst:
print("false")
else:
print("true")

lst = [];
lst.append(True);
lst.append(False);
lst = []
lst.append(True)
lst.append(False)
if messageObj.bo != lst:
print("false")
else:
print("true")

lst = [];
lst = []
lst.append(-500)
lst.append(-24454890000)
if messageObj.si64 != lst:
print("false")
else:
print("true")

lst = [];
lst = []
lst.append(-50)
lst.append(-2445489)
if messageObj.si32 != lst:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
messageObj.si64 = -675348989989
messageObj.si32 = -214748364

messageObj.byt = b'\x97\xB3\xE6\xCC\x01';
messageObj.byt = b'\x97\xB3\xE6\xCC\x01'

messageObj.st = "Protobuf implementation for chapel"

Expand All @@ -23,8 +23,8 @@
messageObj.fl = 444.23444
messageObj.db = 444444444444.23444

messageObj.sf32 = -4567;
messageObj.sf64 = 6473899292;
messageObj.sf32 = -4567
messageObj.sf64 = 6473899292

file = open("out", "wb")
file.write(messageObj.SerializeToString())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import random
import time

n = 128*1024*1024;
n = 128*1024*1024

t1 = time.time()
array = [random.randint(0, 0xffffffffffffffff) for _ in range(n)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def setUp(self):
self.env = os.environ.copy()

def runCmd(self, cmd):
output = runCmd(cmd, self.env);
output = runCmd(cmd, self.env)
return output

def test_00_base(self):
Expand Down Expand Up @@ -271,7 +271,7 @@ def getDir(compiler):

# If $CHPL_HOME is not set, use the base installation of the compiler

chpl_home=os.getenv('CHPL_HOME', chpl_base);
chpl_home=os.getenv('CHPL_HOME', chpl_base)
chpl_home=os.path.normpath(chpl_home)

# Find the test directory
Expand All @@ -282,7 +282,7 @@ def getDir(compiler):
Fatal('Cannot find test directory '+chpl_home+'/test or '+testdir)
# Needed for MacOS mount points
testdir = os.path.realpath(testdir)
# sys.stdout.write('testdir='+testdir+'\n');
# sys.stdout.write('testdir='+testdir+'\n')

# If user specified a different test directory (e.g. with --test-root flag on
# start_test), use it instead.
Expand Down
10 changes: 5 additions & 5 deletions test/runtime/configMatters/launch/jhh/reservation/reservation.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def skipif():
class SrunTests(unittest.TestCase):
@classmethod
def setUpClass(cls):
pass;
pass

def setUp(self):
if skipReason is not None:
Expand All @@ -70,7 +70,7 @@ def setUp(self):
self.env.pop('CHPL_LAUNCHER_USE_SBATCH', None)

def runCmd(self, cmd):
output = runCmd(cmd, self.env);
output = runCmd(cmd, self.env)
return output

def test_00_base(self):
Expand Down Expand Up @@ -145,7 +145,7 @@ def runCmd(self, cmd):
output = super().runCmd(cmd)
batch = output.split()[-1]
with open(batch) as fd:
output = fd.read();
output = fd.read()
os.unlink(batch)
return output

Expand Down Expand Up @@ -178,7 +178,7 @@ def getDir(compiler):

# If $CHPL_HOME is not set, use the base installation of the compiler

chpl_home=os.getenv('CHPL_HOME', chpl_base);
chpl_home=os.getenv('CHPL_HOME', chpl_base)
chpl_home=os.path.normpath(chpl_home)

# Find the test directory
Expand All @@ -189,7 +189,7 @@ def getDir(compiler):
Fatal('Cannot find test directory '+chpl_home+'/test or '+testdir)
# Needed for MacOS mount points
testdir = os.path.realpath(testdir)
# sys.stdout.write('testdir='+testdir+'\n');
# sys.stdout.write('testdir='+testdir+'\n')

# If user specified a different test directory (e.g. with --test-root flag on
# start_test), use it instead.
Expand Down
12 changes: 6 additions & 6 deletions test/runtime/jhh/colocales/colocales.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def setUp(self):
def runCmd(self, cmd, env=None):
if env is None:
env = self.env
output = runCmd(cmd, env=env, check=False);
output = runCmd(cmd, env=env, check=False)
return output

# Returns a list of cores in the specified partition
Expand Down Expand Up @@ -324,7 +324,7 @@ def test_12_leftover_cores(self):
Warn about unused cores
"""
output = self.runCmd("./colocales -r 0 -n 17")
self.assertIn("warning: 9 cores are unused\n", output);
self.assertIn("warning: 9 cores are unused\n", output)

def test_13_remainder_node(self):
"""
Expand Down Expand Up @@ -384,7 +384,7 @@ def test_10_one_colocale(self):
"""
Single locale gets all the GPUs
"""
output = self.runCmd("./colocales -r 0 -n 1");
output = self.runCmd("./colocales -r 0 -n 1")
self.assertIn("GPUS: " + ' '.join(self.gpus), output)

def test_11_two_colocales(self):
Expand All @@ -393,7 +393,7 @@ def test_11_two_colocales(self):
"""
for i in range(0, 2):
with self.subTest(i=i):
output = self.runCmd("./colocales -r %d -n 2" % i);
output = self.runCmd("./colocales -r %d -n 2" % i)
x = i * 2
self.assertIn("GPUS: " + ' '.join(self.gpus[x:x+1]), output)

Expand All @@ -403,7 +403,7 @@ def test_12_four_colocales(self):
"""
for i in range(0, 4):
with self.subTest(i=i):
output = self.runCmd("./colocales -r %d -n 4" % i);
output = self.runCmd("./colocales -r %d -n 4" % i)
self.assertIn("GPUS: " + self.gpus[i], output)

def test_13_oversubscribed(self):
Expand All @@ -412,7 +412,7 @@ def test_13_oversubscribed(self):
"""
for i in range(0, 4):
with self.subTest(i=i):
output = self.runCmd("./colocales -r %d -a 4" % i);
output = self.runCmd("./colocales -r %d -a 4" % i)
self.assertIn("GPUS: " + ' '.join(self.gpus), output)


Expand Down
4 changes: 2 additions & 2 deletions test/runtime/jhh/cpuKinds/cpuKinds.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ def skipif():
class SrunTests(unittest.TestCase):
@classmethod
def setUpClass(cls):
pass;
pass

def setUp(self):
if skipReason is not None:
self.skipTest(skipReason)
self.env = os.environ.copy()
self.env['HWLOC_XMLFILE'] = 'alderLake.xml'
def runCmd(self, cmd):
output = runCmd(cmd, env=self.env, check=False);
output = runCmd(cmd, env=self.env, check=False)
return output

def test_00_base(self):
Expand Down
4 changes: 2 additions & 2 deletions test/runtime/jhh/lps/lps_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def getDir(compiler):

# If $CHPL_HOME is not set, use the base installation of the compiler

chpl_home=os.getenv('CHPL_HOME', chpl_base);
chpl_home=os.getenv('CHPL_HOME', chpl_base)
chpl_home=os.path.normpath(chpl_home)

# Find the test directory
Expand All @@ -372,7 +372,7 @@ def getDir(compiler):
Fatal('Cannot find test directory '+chpl_home+'/test or '+testdir)
# Needed for MacOS mount points
testdir = os.path.realpath(testdir)
# sys.stdout.write('testdir='+testdir+'\n');
# sys.stdout.write('testdir='+testdir+'\n')

# If user specified a different test directory (e.g. with --test-root flag on
# start_test), use it instead.
Expand Down
2 changes: 1 addition & 1 deletion test/runtime/jhh/misc/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def setUp(self):
def runCmd(self, cmd, env=None):
if env is None:
env = self.env
output = runCmd(cmd, env=env, check=False);
output = runCmd(cmd, env=env, check=False)
return output

def getCores(self, base=0):
Expand Down
Loading

0 comments on commit 7249ca9

Please sign in to comment.