Skip to content
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

Kotlin idioms #1063

Merged
merged 42 commits into from
Dec 7, 2023
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
fce39db
Replace String.format
Goooler Dec 3, 2023
e40236e
Use `check` function to check version requirement
Goooler Dec 5, 2023
a3da155
Suppress magic nums in SemanticVersion
Goooler Dec 5, 2023
ce9a412
Refine Kdoc
Goooler Dec 5, 2023
53a74ba
Suppress MaxLineLength for PATTERN
Goooler Dec 5, 2023
c1fa650
Suppress MaxLineLength for SUPPORTED_VERSION
Goooler Dec 5, 2023
83e56c2
Fix MaxLineLength for SpotBugsExtension
Goooler Dec 5, 2023
0aae482
Fix MaxLineLength for SpotBugsRunnerForHybrid
Goooler Dec 5, 2023
899e17e
Remove lines
Goooler Dec 5, 2023
6644b14
Fix TooGenericExceptionCaught for SpotBugsRunner
Goooler Dec 5, 2023
abdca8a
Suppress LongMethod
Goooler Dec 5, 2023
36d0d7e
Remove baseline file
Goooler Dec 5, 2023
eac92e6
Fix style
Goooler Dec 5, 2023
f4f42c1
Fix detekt issues
Goooler Dec 5, 2023
0e508ef
Replace @see
Goooler Dec 5, 2023
11e2b04
Replace Stream usages
Goooler Dec 5, 2023
9612a10
Use buildList
Goooler Dec 5, 2023
594a90d
Rearrange
Goooler Dec 5, 2023
94e4dd6
Use more Sequence
Goooler Dec 5, 2023
a80e824
Replace Path usages
Goooler Dec 5, 2023
d45c82c
Don't use File::toURI
Goooler Dec 5, 2023
d614242
Remove Optional usages
Goooler Dec 5, 2023
66afb5a
Rename toCommandLineOption
Goooler Dec 5, 2023
dd5b52c
Rearrange
Goooler Dec 6, 2023
cbec46e
Use error
Goooler Dec 6, 2023
0f1c35f
Use apply
Goooler Dec 6, 2023
de8c96a
Rearrange
Goooler Dec 6, 2023
317e9c5
Remove redundant this
Goooler Dec 6, 2023
7dcf2ec
Remove separator params
Goooler Dec 6, 2023
60b7d3e
Replace hasProperty usage
Goooler Dec 6, 2023
efceb42
Use require
Goooler Dec 7, 2023
5ca4f7b
Refine comment
Goooler Dec 7, 2023
b4d0f4b
Clean up unnecessary context params
Goooler Dec 7, 2023
cd380cf
Less nesting
Goooler Dec 7, 2023
552c205
Simplify Action types
Goooler Dec 7, 2023
243fe33
Inline getSourceSetContainer
Goooler Dec 7, 2023
2789bbd
Suppress unused for Extensions.kt
Goooler Dec 7, 2023
d598905
Merge remote-tracking branch 'origin/master' into fix-detekt-rules
Goooler Dec 7, 2023
9967884
Api dump
Goooler Dec 7, 2023
36f894a
Mark internal classes
Goooler Dec 7, 2023
1efac1c
Refined comments by AI
Goooler Dec 7, 2023
3ca15da
Inline values
Goooler Dec 7, 2023
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
Prev Previous commit
Next Next commit
Less nesting
Goooler committed Dec 7, 2023
commit cd380cf757df1bba533af9ef1b5e99d19f106d83
Original file line number Diff line number Diff line change
@@ -133,27 +133,25 @@ class SpotBugsRunnerForHybrid(
return (exitValue.xor(MISSING_CLASS_FLAG))
}

private fun configureJavaExec(params: SpotBugsWorkParameters): Action<JavaExecSpec> {
return Action {
it.jvmArgs = params.getJvmArgs().get()
it.classpath(params.getClasspath())
it.setArgs(params.getArgs().get())
it.mainClass.set("edu.umd.cs.findbugs.FindBugs2")
val maxHeapSize = params.getMaxHeapSize().getOrNull()
if (maxHeapSize != null) {
it.maxHeapSize = maxHeapSize
}
if (params.getJavaToolchainExecutablePath().isPresent) {
log.info(
"Spotbugs will be executed using Java Toolchain configuration: {}",
params.getJavaToolchainExecutablePath().get(),
)
it.executable = params.getJavaToolchainExecutablePath().get()
}
it.setIgnoreExitValue(true)
stderrOutputScanner = OutputScanner(System.err)
it.setErrorOutput(stderrOutputScanner)
private fun configureJavaExec(params: SpotBugsWorkParameters): Action<JavaExecSpec> = Action {
it.jvmArgs = params.getJvmArgs().get()
it.classpath(params.getClasspath())
it.setArgs(params.getArgs().get())
it.mainClass.set("edu.umd.cs.findbugs.FindBugs2")
val maxHeapSize = params.getMaxHeapSize().getOrNull()
if (maxHeapSize != null) {
it.maxHeapSize = maxHeapSize
}
if (params.getJavaToolchainExecutablePath().isPresent) {
log.info(
"Spotbugs will be executed using Java Toolchain configuration: {}",
params.getJavaToolchainExecutablePath().get(),
)
it.executable = params.getJavaToolchainExecutablePath().get()
}
it.setIgnoreExitValue(true)
stderrOutputScanner = OutputScanner(System.err)
it.setErrorOutput(stderrOutputScanner)
}
}

Original file line number Diff line number Diff line change
@@ -69,29 +69,27 @@ class SpotBugsRunnerForJavaExec @Inject constructor(
}
}

private fun configureJavaExec(task: SpotBugsTask): Action<JavaExecSpec> {
return Action {
val args = mutableListOf<String>()
args.add("-exitcode")
args.addAll(buildArguments(task))
it.classpath(task.spotbugsClasspath)
it.jvmArgs = buildJvmArguments(task)
it.mainClass.set("edu.umd.cs.findbugs.FindBugs2")
it.setArgs(args)
val maxHeapSize = task.maxHeapSize.getOrNull()
if (maxHeapSize != null) {
it.maxHeapSize = maxHeapSize
}
stderrOutputScanner = OutputScanner(System.err)
it.setErrorOutput(stderrOutputScanner)
if (javaLauncher.isPresent) {
log.info(
"Spotbugs will be executed using Java Toolchain configuration: Vendor: {} | Version: {}",
javaLauncher.get().metadata.vendor,
javaLauncher.get().metadata.languageVersion.asInt(),
)
it.executable = javaLauncher.get().executablePath.asFile.absolutePath
}
private fun configureJavaExec(task: SpotBugsTask): Action<JavaExecSpec> = Action {
val args = mutableListOf<String>()
args.add("-exitcode")
args.addAll(buildArguments(task))
it.classpath(task.spotbugsClasspath)
it.jvmArgs = buildJvmArguments(task)
it.mainClass.set("edu.umd.cs.findbugs.FindBugs2")
it.setArgs(args)
val maxHeapSize = task.maxHeapSize.getOrNull()
if (maxHeapSize != null) {
it.maxHeapSize = maxHeapSize
}
stderrOutputScanner = OutputScanner(System.err)
it.setErrorOutput(stderrOutputScanner)
if (javaLauncher.isPresent) {
log.info(
"Spotbugs will be executed using Java Toolchain configuration: Vendor: {} | Version: {}",
javaLauncher.get().metadata.vendor,
javaLauncher.get().metadata.languageVersion.asInt(),
)
it.executable = javaLauncher.get().executablePath.asFile.absolutePath
}
}
}