You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix very minor continuation bugs for better coverage
There were some very minor/subtle bugs in how I implemented continuation that wouldn't affect any real-world parsing we did, but still bothered me because I'm me. This fixes them (and further increases test coverage as a result).
// TODO *technically* a line like " RUN echo hi " should be parsed as "RUN" "echo hi" (cut off instruction, then the rest of the line with TrimSpace), but for our needs "strings.Fields" is good enough for now
69
+
70
+
// line = strings.TrimSpace(line) // (emulated below; "strings.Fields" does essentially the same exact thing so we don't need to do it explicitly here too)
# but everything below this is part of a single continuation
95
+
96
+
FROM\
97
+
98
+
\
99
+
\
100
+
101
+
\
102
+
\
103
+
104
+
# comments inside are fine
105
+
# and really yucky empty lines:
106
+
107
+
\
108
+
\
109
+
110
+
scratch\
111
+
`,
112
+
metadata: dockerfile.Metadata{
113
+
Froms: []string{"scratch", "scratch"},
114
+
},
115
+
},
78
116
{
79
117
// TODO is this even something that's supported by classic builder/buildkit? (Tianon *thinks* it was supported once, but maybe he's misremembering and it's never been a thing Dockerfiles, only docker build --target=N ?)
0 commit comments