-
Notifications
You must be signed in to change notification settings - Fork 0
Sourcery refactored develop branch #1
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
base: develop
Are you sure you want to change the base?
Conversation
| 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") | ||
| ) | ||
| ) |
There was a problem hiding this comment.
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:
- Lift code into else after jump in control flow (
reintroduce-else) - Replace if statement with if expression (
assign-if-exp) - Simplify boolean if expression (
boolean-if-exp-identity)
| if (debug): | ||
| print("munge input: %s" % name) | ||
| if debug: | ||
| print(f"munge input: {name}") |
There was a problem hiding this comment.
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:
- Replace interpolated string formatting with f-string [×2] (
replace-interpolation-with-fstring)
| 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) |
There was a problem hiding this comment.
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:
- Replace interpolated string formatting with f-string [×2] (
replace-interpolation-with-fstring) - Simplify logical expression using De Morgan identities [×2] (
de-morgan) - Use x is None rather than x == None (
none-compare)
| 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) |
There was a problem hiding this comment.
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:
- Replace if statement with if expression (
assign-if-exp) - Use x is None rather than x == None (
none-compare) - Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring)
| 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 |
There was a problem hiding this comment.
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:
- Replace if statement with if expression (
assign-if-exp) - Use x is None rather than x == None (
none-compare)
| 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) |
There was a problem hiding this comment.
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:
- Replace if statement with if expression (
assign-if-exp) - Use x is None rather than x == None (
none-compare) - Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring)
| 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])}" |
There was a problem hiding this comment.
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:
- Replace
list()with[](list-literal) - Simplify sequence length comparison (
simplify-len-comparison) - Use x is None rather than x == None (
none-compare) - Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring) - Replace comparison with min/max call (
min-max-identity)
| command = '%s --gtest_output="xml:%s.xml"' % (executable, xml) | ||
| command = f'{executable} --gtest_output="xml:{xml}.xml"' |
There was a problem hiding this comment.
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:
- Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring) - Replace call to format with f-string (
use-fstring-for-formatting)
|
|
There was a problem hiding this comment.
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:
- Replace interpolated string formatting with f-string [×7] (
replace-interpolation-with-fstring)
Branch
developrefactored 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
developbranch, then run:Help us improve this pull request!