-
Notifications
You must be signed in to change notification settings - Fork 198
Gradle: Add additional development and test configurations for common plugins #1685
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
Changes from all commits
077b3d1
3f2f3d2
31b95ee
ce9fe8f
94d53c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,15 +39,19 @@ getLinesWithPrefix text prefix = prefixLines | |
| configNameToLabel :: Text -> GradleLabel | ||
| configNameToLabel conf = | ||
| case conf of | ||
| "compileOnly" -> Env EnvDevelopment | ||
| x | x `elem` knownDevConfigs -> Env EnvDevelopment | ||
| x | x `elem` knownTestConfigs -> Env EnvTesting | ||
| x | isDefaultAndroidDevConfig x -> Env EnvDevelopment | ||
| x | isDefaultAndroidTestConfig x -> Env EnvTesting | ||
| x -> Env $ EnvOther x | ||
|
|
||
| knownTestConfigs :: [Text] | ||
| knownTestConfigs = | ||
| [ "testImplementation" | ||
| [ "aggregateCodeCoverageReportResults" | ||
| , "jacocoAgent" | ||
| , "jacocoAggregation" | ||
| , "jacocoAnt" | ||
|
Comment on lines
+50
to
+53
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add explicit tests for the new config-name mappings. As per coding guidelines, "Code should be thoroughly tested with appropriate unit tests". Also applies to: 68-74 🤖 Prompt for AI Agents |
||
| , "testImplementation" | ||
| , "testCompileOnly" | ||
| , "testRuntimeOnly" | ||
| , "testCompileClasspath" | ||
|
|
@@ -61,6 +65,14 @@ knownTestConfigs = | |
| , "testFixturesApiElements" | ||
| ] | ||
|
|
||
| knownDevConfigs :: [Text] | ||
| knownDevConfigs = | ||
| [ "compileOnly" | ||
| , "spotbugs" | ||
| , "spotbugsPlugins" | ||
| , "spotbugsSlf4j" | ||
| ] | ||
|
|
||
| getDebugMessages :: Text -> [Text] | ||
| getDebugMessages text = getLogWithPrefix text "FOSSA-DEBUG" | ||
|
|
||
|
|
||
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.
🛠️ Refactor suggestion | 🟠 Major
🧩 Analysis chain
🏁 Script executed:
cat -n src/Strategy/Gradle/Common.hs | head -60Repository: fossas/fossa-cli
Length of output: 2395
Replace match guards in
configNameToLabel.This function uses match guards (
|syntax), which violates the Haskell guideline: "avoid partial functions, list comprehensions, and match guards."Suggested refactor
🤖 Prompt for AI Agents