File tree Expand file tree Collapse file tree
java/org/openrewrite/docker/internal/grammar
test/java/org/openrewrite/docker Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ subprojects {
3131 doLast {
3232 val idx = args?.indexOf(" -o" ) ? : return @doLast
3333 if (idx < 0 || idx + 1 >= args!! .size) return @doLast
34- val rootPrefix = rootProject.projectDir.absolutePath + " /"
34+ val rootPrefix = rootProject.projectDir.absolutePath.replace( " \\ " , " / " ) + " /"
3535 val year = Calendar .getInstance().get(Calendar .YEAR )
3636 val licenseHeader = " /*\n " + rootProject.file(" gradle/licenseHeader.txt" )
3737 .readText().trim()
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ EQUALS : '=' { if (!afterHealthcheck) atLineStart = false; };
8989// Captures the entire flag as a single token, stopping at whitespace
9090// This avoids the greedy flagValue+ parsing issue while keeping shell commands working
9191// Flag values can contain quoted strings (which may include spaces)
92- FLAG : ' --' [a-zA- Z ] [a-zA- Z0 -9_-]* (' =' FLAG_VALUE_PART +)? { if (!afterHealthcheck) atLineStart = false ; } ;
92+ FLAG : ' --' [a-z ] [a-z0 -9_-]* (' =' FLAG_VALUE_PART +)? { if (!afterHealthcheck) atLineStart = false ; } ;
9393fragment FLAG_VALUE_PART
9494 : ' "' ( ' \\ ' ~[\r\n] | ~[" \\\r\n ] )* '" ' // Double-quoted string (with escapes)
9595 | ' \' ' ~[' \r\n ]* ' \' ' // Single-quoted string (literal)
Original file line number Diff line number Diff line change 1313 * See the License for the specific language governing permissions and
1414 * limitations under the License.
1515 */
16- // Generated from C:/Users/sambs/projects/openrewrite/rewrite/ rewrite-docker/src/main/antlr/DockerLexer.g4 by ANTLR 4.13.2
16+ // Generated from rewrite-docker/src/main/antlr/DockerLexer.g4 by ANTLR 4.13.2
1717package org .openrewrite .docker .internal .grammar ;
1818import java .util .LinkedList ;
1919import java .util .Queue ;
Original file line number Diff line number Diff line change 1313 * See the License for the specific language governing permissions and
1414 * limitations under the License.
1515 */
16- // Generated from C:/Users/sambs/projects/openrewrite/rewrite/ rewrite-docker/src/main/antlr/DockerParser.g4 by ANTLR 4.13.2
16+ // Generated from rewrite-docker/src/main/antlr/DockerParser.g4 by ANTLR 4.13.2
1717package org .openrewrite .docker .internal .grammar ;
1818import org .antlr .v4 .runtime .atn .*;
1919import org .antlr .v4 .runtime .dfa .DFA ;
Original file line number Diff line number Diff line change 1313 * See the License for the specific language governing permissions and
1414 * limitations under the License.
1515 */
16- // Generated from C:/Users/sambs/projects/openrewrite/rewrite/ rewrite-docker/src/main/antlr/DockerParser.g4 by ANTLR 4.13.2
16+ // Generated from rewrite-docker/src/main/antlr/DockerParser.g4 by ANTLR 4.13.2
1717package org .openrewrite .docker .internal .grammar ;
1818
1919import org .antlr .v4 .runtime .ParserRuleContext ;
Original file line number Diff line number Diff line change 1313 * See the License for the specific language governing permissions and
1414 * limitations under the License.
1515 */
16- // Generated from C:/Users/sambs/projects/openrewrite/rewrite/ rewrite-docker/src/main/antlr/DockerParser.g4 by ANTLR 4.13.2
16+ // Generated from rewrite-docker/src/main/antlr/DockerParser.g4 by ANTLR 4.13.2
1717package org .openrewrite .docker .internal .grammar ;
1818import org .antlr .v4 .runtime .tree .AbstractParseTreeVisitor ;
1919
Original file line number Diff line number Diff line change 1313 * See the License for the specific language governing permissions and
1414 * limitations under the License.
1515 */
16- // Generated from C:/Users/sambs/projects/openrewrite/rewrite/ rewrite-docker/src/main/antlr/DockerParser.g4 by ANTLR 4.13.2
16+ // Generated from rewrite-docker/src/main/antlr/DockerParser.g4 by ANTLR 4.13.2
1717package org .openrewrite .docker .internal .grammar ;
1818import org .antlr .v4 .runtime .tree .ParseTreeListener ;
1919
Original file line number Diff line number Diff line change 1313 * See the License for the specific language governing permissions and
1414 * limitations under the License.
1515 */
16- // Generated from C:/Users/sambs/projects/openrewrite/rewrite/ rewrite-docker/src/main/antlr/DockerParser.g4 by ANTLR 4.13.2
16+ // Generated from rewrite-docker/src/main/antlr/DockerParser.g4 by ANTLR 4.13.2
1717package org .openrewrite .docker .internal .grammar ;
1818import org .antlr .v4 .runtime .tree .ParseTreeVisitor ;
1919
Original file line number Diff line number Diff line change @@ -86,6 +86,22 @@ void comprehensiveDockerfile() {
8686 );
8787 }
8888
89+ @ Test
90+ void caseInsensitiveInstructions () {
91+ rewriteRun (
92+ docker (
93+ """
94+ from ubuntu:20.04
95+ run apt-get update
96+ copy app.jar /app/
97+ Env MY_VAR=value
98+ expose 8080
99+ Cmd ["./app"]
100+ """
101+ )
102+ );
103+ }
104+
89105 @ Test
90106 void multipleJsonArrayWhitespaceStyles () {
91107 // Test different whitespace styles in JSON arrays are preserved
You can’t perform that action at this time.
0 commit comments