-
Notifications
You must be signed in to change notification settings - Fork 516
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
Chrisdias/linting #42
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of my comments are just questions, so feel free to ignore them :) This looks awesome, and will be a nice addition to the extension!
@@ -1,2 +1,3 @@ | |||
out | |||
out/**/*.js | |||
out/**/*.map |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we ignore the yaml files that are in the out directory as well? It seems like the extension doesn't use them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually it does use the .yaml files, they are the linting rules. i had to change gitignore to persist them. happy if you have another way to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
} | ||
} | ||
|
||
diagnosticCollection.set(document.uri, diagnostics); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we do anything with the info-level linting messages? It seems like the default rules files include some.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also forgot to do this :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -54,4 +58,16 @@ export function activate(ctx: vscode.ExtensionContext): void { | |||
ctx.subscriptions.push(vscode.commands.registerCommand('vscode-docker.container.open-shell', openShellContainer)); | |||
ctx.subscriptions.push(vscode.commands.registerCommand('vscode-docker.compose.up', composeUp)); | |||
ctx.subscriptions.push(vscode.commands.registerCommand('vscode-docker.compose.down', composeDown)); | |||
|
|||
diagnosticCollection = vscode.languages.createDiagnosticCollection('docker-diagnostics'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we want to check whether linting was enabled? I noticed you added a config option to turn it on/off, but didn't see if it was checked before scheduling linting validations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forgot to do this :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
reference_url: | ||
- "https://docs.docker.com/reference/builder/" | ||
- "#from" | ||
label: "no_tag" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this rule and the one below it missing their hyphen delimiter? The rules for the RUN directive below each have one, which I had thought was the correct syntax for lists in yaml.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these came with dockerfile_lint so i don't know. but, we can remove all these per the above comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
let diagnostics: vscode.Diagnostic[] = []; | ||
|
||
let linterRuleFile = configOptions.get('linterRuleFile', 'basic_rules.yaml'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this lib will actually default to using this exact rules file if you specific a null/empty rules file path, so we could choose not to ship any of these sample rules file, and allow either turning on the default rules or specifying a custom one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting... i would rather remove the rules files and go with the defaults. but, i'll keep the ability to create a new rules file and drop into the root of the workspace. or, i'll go with a full path so you could have 1 on the machine...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"fixed" by not relying on file...
great feedback! i've still got work to do, will make changes and then resubmit. |
LGTM! |
adds linting for dockerfiles using dockerfile_lint library