remove linter since the language server does this now
This commit is contained in:
Chris Dias 2017-08-13 14:08:13 -07:00 коммит произвёл GitHub
Родитель 48cabddade
Коммит dcd9a365fc
8 изменённых файлов: 57 добавлений и 175 удалений

Просмотреть файл

@ -1,6 +1,9 @@
## 0.0.17 - XX XXXX 2017
* Add `docker inspect` command
* Add Explorer contribution, letting you view Images and Containers in the Explorer viewlet.
* Thanks to @rcjsuen, moved to the [Dockerfile Language Server](https://github.com/rcjsuen/dockerfile-language-server-nodejs)
* Update thirdpartynotices.txt, README.md to reflect changes
## 0.0.16 - 09 June 2017

Просмотреть файл

@ -1,29 +1,32 @@
# Docker Support for Visual Studio Code
The Docker extension makes it easy to build and deploy containerized applications from Visual Studio Code.
* Automatic Dockerfile and docker-compose.yml file generation
* Syntax highlighting and hover tips for docker-compose.yml and Dockerfile files
* IntelliSense (completions) for Dockerfile files
* Linting (errors and warnings) for Dockerfile files
* Command Palette (F1) integration for the most common Docker commands (e.g. Build, Push)
* Automatic `Dockerfile` and `docker-compose.yml` file generation
* Syntax highlighting and hover tips for `docker-compose.yml` and `Dockerfile files`
* IntelliSense (completions) for `Dockerfile` and `docker-compose.yml` files
* Linting (errors and warnings) for `Dockerfile` files
* Command Palette (`F1`) integration for the most common Docker commands (e.g. Build, Push)
* Explorer integration for managing Images and Containers
* Deploy images to the cloud by running the [Azure CLI](https://github.com/azure/azure-cli) in a container
## Generating Dockerfile, docker-compose.yml, and docker-compose.debug.yml
## Generating `Dockerfile`, `docker-compose.yml`, and `docker-compose.debug.yml`
![dockerfile](images/generateFiles.gif)
IntelliSense (completions) for Dockerfile and docker-compose.yml files.
## IntelliSense (completions) for `Dockerfile` and `docker-compose.yml` files.
![intelliSense](images/intelliSense.gif)
## Docker commands
Many of the most common Docker and docker-compose commands are built right into the Command Palette (F1).
Many of the most common Docker and docker compose commands are built right into the Command Palette (`F1`).
![intelliSense](images/commands.gif)
## Dockerfile linting
You can enable linting of Dockerfile files through the `docker.enableLinting` setting (CMD+, on MacOS, or Ctrl+, on Windows and Linux). The extension uses the awesome [dockerfile_lint](https://github.com/projectatomic/dockerfile_lint) rules based linter to analyze the Dockerfile. You can provide your own customized rules file by setting the `docker.linterRuleFile` setting. You can find [more information](https://github.com/projectatomic/dockerfile_lint#extending-and-customizing-rule-files) on how to create rules files as well as [sample rules files](https://github.com/projectatomic/dockerfile_lint/tree/master/sample_rules) in the [dockerfile_lint](https://github.com/projectatomic/dockerfile_lint) project.
## Explorer Integration
The Docker Explorer lets you view and manage your Images and Containers. The right click context menu provides quick access to the same rich set of commands found in the Command Palette (`F1`).
![linting](images/linting.gif)
![explorer integration](images/explorer.gif)
> Note: You can move the Explorer up or down by dragging the `DOCKER` sash, you can hide the Explorer by right clicking on the `DOCKER` sash and choosing `Remove from side bar`. To bring it back, right click on the `EXPLORER` title at the top of the side bar.
## Azure CLI
Microsoft ships the latest [Azure CLI](https://github.com/azure/azure-cli) as a [Docker image](https://hub.docker.com/r/azuresdk/azure-cli-python/). You can easily launch a container running the CLI from the Command Palette (press F1 and search for `Docker: Azure CLI`). The extension will then run an interactive terminal attached to the container.

Просмотреть файл

@ -22,7 +22,6 @@ import { openShellContainer } from './commands/open-shell-container';
import { tagImage } from './commands/tag-image';
import { composeUp, composeDown } from './commands/docker-compose';
import { configure, configureLaunchJson } from './configureWorkspace/configure';
import { scheduleValidate } from './linting/dockerLinting';
import { systemPrune } from './commands/system-prune';
import { Reporter } from './telemetry/telemetry';
import DockerInspectDocumentContentProvider, { SCHEME as DOCKER_INSPECT_SCHEME } from './documentContentProviders/dockerInspect';
@ -85,16 +84,6 @@ export function activate(ctx: vscode.ExtensionContext): void {
ctx.subscriptions.push(vscode.commands.registerCommand('vscode-docker.compose.down', composeDown));
ctx.subscriptions.push(vscode.commands.registerCommand('vscode-docker.system.prune', systemPrune));
diagnosticCollection = vscode.languages.createDiagnosticCollection('docker-diagnostics');
ctx.subscriptions.push(diagnosticCollection);
vscode.workspace.onDidChangeTextDocument((e) => scheduleValidate(e.document), ctx.subscriptions);
vscode.workspace.textDocuments.forEach((doc) => scheduleValidate(doc));
vscode.workspace.onDidOpenTextDocument((doc) => scheduleValidate(doc), ctx.subscriptions);
vscode.workspace.onDidCloseTextDocument((doc) => diagnosticCollection.delete(doc.uri), ctx.subscriptions);
activateLanguageClient(ctx);
}

Просмотреть файл

@ -31,7 +31,7 @@ export class DockerExplorerProvider implements vscode.TreeDataProvider<DockerNod
}
private setAutoRefresh(): void {
// from https://github.com/formulahendry/vscode-docker-explorer/blob/master/src/dockerTreeBase.ts
const configOptions: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration('docker');
const interval = configOptions.get('explorerRefreshInterval', 1000);

Двоичные данные
images/explorer.gif Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 70 KiB

Просмотреть файл

@ -1,115 +0,0 @@
import vscode = require('vscode');
import { diagnosticCollection } from '../dockerExtension';
import * as fs from 'fs';
import * as path from 'path';
var DockerFileValidator = require('dockerfile_lint');
let configOptions: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration('docker');
function createErrDiagnostic(e, doc: vscode.TextDocument): vscode.Diagnostic {
var r: vscode.Range;
var lineNum = -1;
var msg = e.message;
if (e.line) {
lineNum = e.line;
}
if (lineNum === -1) {
r = new vscode.Range(0, 0, 0, 0);
} else {
r = doc.lineAt(lineNum - 1).range
}
if (e.lineContent) {
msg = msg + ': ' + e.lineContent;
}
return new vscode.Diagnostic(r, msg, vscode.DiagnosticSeverity.Error);
}
export function scheduleValidate(document: vscode.TextDocument) {
let urisToValidate: { [uri: string]: boolean; } = {};
let timeoutToken: NodeJS.Timer = null;
// should we even try validation? if not, get out!
configOptions = vscode.workspace.getConfiguration('docker');
if (!(configOptions.get('enableLinting', false)) || document.languageId !== 'dockerfile') {
return ;
}
// schedule valiation so we're not invoking this on every keypress
urisToValidate[document.uri.toString()] = true;
if (timeoutToken !== null) {
clearTimeout(timeoutToken);
}
timeoutToken = setTimeout(() => {
timeoutToken = null;
vscode.workspace.textDocuments.forEach((document) => {
if (urisToValidate[document.uri.toString()]) {
doValidate(document);
}
});
urisToValidate = {};
}, 200);
return;
}
function doValidate(document: vscode.TextDocument) {
let diagnostics: vscode.Diagnostic[] = [];
configOptions = vscode.workspace.getConfiguration('docker');
let linterRuleFile = configOptions.get('linterRuleFile', '');
// validate file exists
if (linterRuleFile.length !== 0) {
// fully qualified path to file?
if (!fs.existsSync(path.normalize(linterRuleFile))) {
// if not, check to see if it is in the root of the workspace
if (!fs.existsSync(path.normalize(vscode.workspace.rootPath + '/' + linterRuleFile))) {
// we can't find the rules file, default to '' which will use the default
linterRuleFile = '';
} else {
linterRuleFile = path.normalize(vscode.workspace.rootPath + '/' + linterRuleFile);
}
} else {
linterRuleFile = path.normalize(linterRuleFile);
}
}
try {
let validator = new DockerFileValidator(linterRuleFile);
let result = validator.validate(document.getText());
if (result.error.count > 0) {
for (let i = 0; i < result.error.count; i++) {
diagnostics.push(createErrDiagnostic(result.error.data[i], document));
}
}
if (result.warn.count > 0) {
for (let i = 0; i < result.warn.count; i++) {
diagnostics.push(new vscode.Diagnostic(new vscode.Range(0, 0, 0, 0), result.warn.data[i].message + ': ' + result.warn.data[i].description, vscode.DiagnosticSeverity.Warning));
}
}
if (result.info.count > 0) {
for (let i = 0; i < result.info.count; i++) {
diagnostics.push(new vscode.Diagnostic(new vscode.Range(0, 0, 0, 0), result.info.data[i].message + ': ' + result.info.data[i].description, vscode.DiagnosticSeverity.Information));
}
}
diagnosticCollection.set(document.uri, diagnostics);
} catch (err) {
console.log(err);
}
}

Просмотреть файл

@ -194,16 +194,6 @@
"default": "",
"description": "Path within registry to push to."
},
"docker.enableLinting": {
"type": "boolean",
"default": false,
"description": "Turn linting of Dockerfiles on or off."
},
"docker.linterRuleFile": {
"type": "string",
"default": "",
"description": "Full path to the linting rules file to use. See https://github.com/projectatomic/dockerfile_lint#extending-and-customizing-rule-files) for sample files and how to create your own."
},
"docker.showExplorer": {
"type": "boolean",
"default": true,
@ -391,7 +381,6 @@
"@types/node": "^6.0.40"
},
"dependencies": {
"dockerfile_lint": "^0.2.6",
"dockerfile-language-server-nodejs": "^0.0.6",
"dockerode": "^2.3.2",
"vscode-extension-telemetry": "^0.0.6",

Просмотреть файл

@ -5,7 +5,7 @@ This project incorporates material from the projects listed below. The original
and the license under which Microsoft received such material are set out below. Microsoft reserves
all other rights not expressly granted, whether by implication, estoppel or otherwise.
1. DefinitelyTyped version 0.0.1 (https://github.com/borisyankov/DefinitelyTyped)
1. DefinitelyTyped version 0.0.1 (https://github.com/borisyankov/DefinitelyTyped)
This project is licensed under the MIT license.
Copyrights are respective of each contributor listed at the beginning of each definition file.
@ -28,31 +28,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
2. dockerfile_lint version 0.2.4 (https://github.com/projectatomic/dockerfile_lint)
The MIT License (MIT)
Copyright (c) 2014 Red Hat, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
3. dockerode versions 2.3.1 (https://github.com/apocas/dockerode)
2. dockerode versions 2.3.1 (https://github.com/apocas/dockerode)
Pedro Dias - @pedromdias
@ -65,3 +41,40 @@ under the license is distributed on an "as is" basis, without warranties or cond
of any kind, either express or implied. See the license for the specific language
governing permissions and limitations under the license.
3. dockerfile-language-server-nodejs version 0.0.6 (https://github.com/rcjsuen/dockerfile-language-server-nodejs)
Copyright (c) 2017 Remy Suen
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4. vscode-docker-explorer version 0.1.1 (https://github.com/formulahendry/vscode-docker-explorer/)
MIT License
Copyright (c) 2017 Jun Han
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
iles (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.