Skip to content
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

Validation crashes if the last instruction spans multiple lines and the final argument is one character long with no leading whitespace #69

Closed
rcjsuen opened this issue Feb 11, 2020 · 0 comments
Assignees
Labels

Comments

@rcjsuen
Copy link
Owner

rcjsuen commented Feb 11, 2020

The root cause is due to rcjsuen/dockerfile-ast#66.

RUN x\
y
$ docker run -v `pwd`/Dockerfile:/Dockerfile rcjsuen/dockerfile-utils lint /Dockerfile
/dockerfile-utils/node_modules/vscode-languageserver-types/lib/main.js:36
            return Is.defined(candidate) && Is.number(candidate.line) && Is.number(candidate.character);
                                                                ^

TypeError: Cannot read property 'line' of null
    at Object.is (/dockerfile-utils/node_modules/vscode-languageserver-types/lib/main.js:36:65)
    at Object.create (/dockerfile-utils/node_modules/vscode-languageserver-types/lib/main.js:50:31)
    at JSONInstruction.getArgumentsRanges (/dockerfile-utils/node_modules/dockerfile-ast/lib/instruction.js:136:57)
    at JSONInstruction.getArgumentsContent (/dockerfile-utils/node_modules/dockerfile-ast/lib/instruction.js:152:27)
    at Validator.checkJSONQuotes (/dockerfile-utils/lib/dockerValidator.js:1032:39)
    at Validator.validateInstruction (/dockerfile-utils/lib/dockerValidator.js:368:26)
    at Validator.validate (/dockerfile-utils/lib/dockerValidator.js:298:18)
    at Object.validate (/dockerfile-utils/lib/main.js:135:22)
    at validate (/dockerfile-utils/bin/dockerfile-utils:161:39)
    at Object.<anonymous> (/dockerfile-utils/bin/dockerfile-utils:35:5)
@rcjsuen rcjsuen added the bug label Feb 11, 2020
@rcjsuen rcjsuen self-assigned this Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant