Feature/readme javadocs ci#2
Conversation
Review Summary by QodoAdd conformance badges and improve error handling
WalkthroughsDescription• Add conformance badge to README documentation • Improve directory creation error handling with validation • Fix Gradle task input tracking for workDir property • Enhance Python executable detection using environment variable Diagramflowchart LR
A["PythonRunnerTask"] -->|"Add workDir path tracking"| B["@Input getWorkDirPath"]
A -->|"Improve directory creation"| C["Error handling validation"]
A -->|"Fix input annotation"| D["@Internal getWorkDir"]
E["README"] -->|"Add badge"| F["Conformance status"]
G["Test"] -->|"Improve detection"| H["Environment variable"]
File Changes1. src/main/java/name/jurgenei/gradle/python/PythonRunnerTask.java
|
Code Review by Qodo
1. Args mutation ignored
|
| @Optional | ||
| @Input | ||
| public List<String> getArgs() { | ||
| return args; | ||
| return new ArrayList<>(args); | ||
| } |
There was a problem hiding this comment.
1. Args mutation ignored 🐞 Bug ≡ Correctness
getArgs() now returns a defensive copy, so build scripts that do task.args.add(...) mutate only the copy and the task still executes with the original internal args field, dropping expected CLI arguments without any error. This is hard to diagnose because runScript() reads the internal field directly, not the getter result.
Agent Prompt
### Issue description
`getArgs()` returns a new `ArrayList` every call. In Gradle/Groovy DSL, users commonly configure list properties via mutation (e.g., `PythonRunnerTask { args.add('foo') }`). With the current implementation, those mutations do not affect the task’s internal `args` field that `runScript()` uses, so the script runs without the intended arguments.
### Issue Context
The task executes with `cmd.addAll(args)` (field), while the getter returns a copy. This creates a silent configuration no-op.
### Fix Focus Areas
- src/main/java/name/jurgenei/gradle/python/PythonRunnerTask.java[41-45]
- src/main/java/name/jurgenei/gradle/python/PythonRunnerTask.java[122-127]
- src/main/java/name/jurgenei/gradle/python/PythonRunnerTask.java[264-282]
### Suggested fix approaches
Pick one:
1) **Gradle-native properties (best):** migrate `args` to a `ListProperty<String>` and use it consistently (execution reads from the property). This supports safe configuration (`args.add(...)`, `args.set(...)`) and proper input tracking.
2) **Minimal behavioral fix:** return the live list from `getArgs()` (so DSL mutations work) and, if SpotBugs complains, suppress that warning for this getter. Also consider making the field `final` and having `setArgs()` clear/add rather than reassigning the list.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Add spotbugs and other checks