Skip to content

Conversation

@sourcery-ai
Copy link

@sourcery-ai sourcery-ai bot commented Sep 20, 2023

Branch develop refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the develop branch, then run:

git fetch origin sourcery/develop
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from bkaplowitz September 20, 2023 07:26
Comment on lines -32 to +37
if (platform.system().lower().startswith("windows")
or os.name.lower().startswith("windows")):
return True
return False
return bool(
(
platform.system().lower().startswith("windows")
or os.name.lower().startswith("windows")
)
)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function isWin refactored with the following changes:

Comment on lines -39 to +42
if (debug):
print("munge input: %s" % name)
if debug:
print(f"munge input: {name}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function mungeName refactored with the following changes:

Comment on lines -57 to +63
print("%s" % command)
print(f"{command}")
p1 = subprocess.Popen(command,shell=True)
p1.wait()
if (not(p1.returncode == None) and not(p1.returncode == 0)):
stopErr('%s failed' % command, p1.returncode)
if p1.returncode is not None and p1.returncode != 0:
stopErr(f'{command} failed', p1.returncode)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function doCommand refactored with the following changes:

Comment on lines -65 to +67
if (j == None):
command = 'make %s' % target
else:
command = 'make -j%d %s' % (j,target)
command = f'make {target}' if j is None else 'make -j%d %s' % (j,target)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function makeTest refactored with the following changes:

Comment on lines -72 to +71
if (j == None):
command = 'make build'
else:
command = 'make -j%d build' % j
command = 'make build' if j is None else 'make -j%d build' % j
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function makeBuild refactored with the following changes:

Comment on lines -80 to +76
if (j == None):
command = 'make %s' % target
else:
command = 'make -j%d %s' % (j,target)
command = f'make {target}' if j is None else 'make -j%d %s' % (j,target)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function makeTestModel refactored with the following changes:

Comment on lines -88 to +95
targets = list()
targets = []
for name in filenames:
if (not name.endswith(testsfx)):
continue
target = "/".join([dirname,name])
target = mungeName(target)
targets.append(target)
if (len(targets) > 0):
if targets:
if (debug):
print('# targets: %d' % len(targets))
startIdx = 0
endIdx = batchSize
while (startIdx < len(targets)):
if (j == None):
command = 'make %s' % ' '.join(targets[startIdx:endIdx])
if j is None:
command = f"make {' '.join(targets[startIdx:endIdx])}"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function makeTests refactored with the following changes:

Comment on lines -124 to +116
command = '%s --gtest_output="xml:%s.xml"' % (executable, xml)
command = f'{executable} --gtest_output="xml:{xml}.xml"'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function runTest refactored with the following changes:

Comment on lines -144 to +136

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function main refactored with the following changes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants