Copilot commented on code in PR #2741:
URL: https://github.com/apache/groovy/pull/2741#discussion_r3663645894


##########
src/spec/doc/tools-groovyc.adoc:
##########
@@ -46,6 +46,7 @@ a number of command line switches:
 | | --encoding | Encoding of the source files | groovyc --encoding utf-8 
script.groovy
 | | --help | Displays help for the command line groovyc tool | groovyc --help
 | -d | | Specify where to place generated class files. | groovyc -d target 
Person.groovy
+| | --check | Check sources for errors without generating class files (stops 
compilation after static analysis) | groovyc --check Person.groovy

Review Comment:
   The docs say --check "stops compilation after static analysis", but the 
implementation stops at Phases.INSTRUCTION_SELECTION (class generation pt.1). 
To avoid misleading users about where compilation stops, rephrase this to the 
concrete user-facing behavior (no class files written) rather than claiming it 
stops after analysis.



##########
src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java:
##########
@@ -556,6 +557,9 @@ public static class CompilationOptions {
         @Option(names = {"--type-checked"}, description = "Use TypeChecked")
         private boolean typeChecked;
 
+        @Option(names = {"--check"}, description = "Check sources for errors 
without generating class files (stops compilation after static analysis)")
+        private boolean checkOnly;

Review Comment:
   The --check option sets the target phase to Phases.INSTRUCTION_SELECTION, 
which is part of class generation ("Class generation (pt.1)" per Phases.java). 
The current help text says it "stops compilation after static analysis", which 
is inaccurate/misleading; the observable guarantee is that no class files are 
written. Consider rewording to describe the no-class-file behavior (and/or that 
it stops before disk output) rather than implying compilation stops at analysis.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to