Skip to content

Commit

Permalink
fix quality violations
Browse files Browse the repository at this point in the history
  • Loading branch information
xvik committed Mar 28, 2024
1 parent 1c8b5db commit 1a2bdf9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ final class PythonBinary {
private static final String SPACE = ' '
private static final String NL = '\n'

private static final Object SYNC = new Object()

private final Environment environment

// pre-init
Expand Down Expand Up @@ -159,7 +157,7 @@ final class PythonBinary {
* @return string to identify python (within current project)
*/
String getIdentity() {
return (isDocker() ? '[docker]' : '') +
return (docker ? '[docker]' : '') +
(sourcePythonPath == null ? '' :
environment.file(sourcePythonPath).canonicalPath
.replace(environment.rootDir.canonicalPath, '')) + (sourcePythonBinary ?: '')
Expand Down Expand Up @@ -321,14 +319,10 @@ final class PythonBinary {
@CompileStatic(TypeCheckingMode.SKIP)
@SuppressWarnings('AssignmentToStaticFieldFromInstanceMethod')
private boolean detectPython3Binary() {
return environment.globalCache("python3.binary:${docker ? dockerManager.containerName : ''}", {
return environment.globalCache("python3.binary:${docker ? dockerManager.containerName : ''}") {
// on windows python binary could not be named python3
if (windows) {
return false
} else {
return rawExec([PYTHON3, '--version'] as String[]) != null
}
})
return !windows && rawExec([PYTHON3, '--version'] as String[]) != null
}
}

private String cleanLoggedCommand(String[] cmd) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import java.text.SimpleDateFormat
@CompileStatic
class StatsPrinter {

@SuppressWarnings(['SimpleDateFormatMissingLocale', 'Println'])
@SuppressWarnings(['SimpleDateFormatMissingLocale', 'Println', 'UnnecessaryGetter'])
static String print(List<PythonStat> stats) {
if (stats.empty) {
return ''
Expand Down

0 comments on commit 1a2bdf9

Please sign in to comment.