diff --git a/src/binutil.ts b/src/binutil.ts index 5c2b6e3b7..39962ee88 100644 --- a/src/binutil.ts +++ b/src/binutil.ts @@ -95,7 +95,7 @@ export async function checkForBinary(context: BinCheckContext, bin: string, binN } context.binFound = context.fs.existsSync(bin); - + if (context.binFound) { context.binPath = bin; } else { diff --git a/src/components/clusterprovider/clusterproviderserver.ts b/src/components/clusterprovider/clusterproviderserver.ts index f7ba58a27..738034998 100644 --- a/src/components/clusterprovider/clusterproviderserver.ts +++ b/src/components/clusterprovider/clusterproviderserver.ts @@ -83,7 +83,7 @@ function handleGetProviderListHtml(action: clusterproviderregistry.ClusterProvid document.getElementById('nextlink').href = selection; } `); - + const html = `

Choose cluster type

diff --git a/src/components/installer/installer.ts b/src/components/installer/installer.ts index 5dcfe6991..4822acc41 100644 --- a/src/components/installer/installer.ts +++ b/src/components/installer/installer.ts @@ -23,7 +23,7 @@ export async function installKubectl(shell: Shell): Promise> { const installFolder = getInstallFolder(shell, tool); mkdirp.sync(installFolder); - + const kubectlUrl = `https://storage.googleapis.com/kubernetes-release/release/${version.result.trim()}/bin/${os}/amd64/${binFile}`; const downloadFile = path.join(installFolder, binFile); const downloadResult = await downloadTo(kubectlUrl, downloadFile); diff --git a/src/debug/debugProvider.ts b/src/debug/debugProvider.ts index 3df1fe464..7eeb8d494 100644 --- a/src/debug/debugProvider.ts +++ b/src/debug/debugProvider.ts @@ -22,7 +22,7 @@ export interface IDebugProvider { /** * Launch the debugger extension and attach to the target debug port. - * + * * @param workspaceFolder the workspace folder path. * @param sessionName the debug session name. * @param port the debugging port exposed by the target program. @@ -32,7 +32,7 @@ export interface IDebugProvider { /** * The docker image is supported by the provider or not. - * + * * @param baseImage the inherited image name. * @return true if the provider can infer the application type from the image name, otherwise, false. */ @@ -40,7 +40,7 @@ export interface IDebugProvider { /** * Resolve the debug port info from the dockerfile. - * + * * @param dockerfile the docker file. * @param env the environment variables defined by the docker file. * @return the resolved debug port info. diff --git a/src/debug/debugSession.ts b/src/debug/debugSession.ts index 439a05706..4ed237b5b 100644 --- a/src/debug/debugSession.ts +++ b/src/debug/debugSession.ts @@ -37,11 +37,11 @@ export class DebugSession implements IDebugSession { /** * In launch mode, build the docker image from docker file first and then run it on kubernetes cluster, - * after that smartly resolve the debugging info from the docker image and create port-forward, + * after that smartly resolve the debugging info from the docker image and create port-forward, * finally start a debugger to attach to the debugging process. - * + * * Besides, when the debug session is terminated, kill the port-forward and cleanup the created kubernetes resources (deployment/pod) automatically. - * + * * @param workspaceFolder the active workspace folder. * @param debugProvider the debug provider. If not specified, prompt user to pick up a debug provider from the supported list. */ @@ -89,15 +89,15 @@ export class DebugSession implements IDebugSession { // Find the running debug pod. p.report({ message: "Finding the debug pod..."}); const podName = await this.findDebugPod(appName); - + // Wait for the debug pod status to be running. p.report({ message: "Waiting for the pod to be ready..."}); await this.waitForPod(podName); - + // Setup port-forward. p.report({ message: "Setting up port forwarding..."}); const proxyResult = await this.setupPortForward(podName, portInfo.debugPort, portInfo.appPort); - + // Start debug session. p.report({ message: `Starting ${this.debugProvider.getDebuggerType()} debug session...`}); await this.startDebugSession(appName, cwd, proxyResult); @@ -255,7 +255,7 @@ export class DebugSession implements IDebugSession { kubeChannel.showOutput(`Setting up port forwarding on pod ${podName}...`, "Set up port forwarding"); const proxyResult = await this.createPortForward(this.kubectl, podName, debugPort, appPort); kubeChannel.showOutput(`Created port-forward ${proxyResult.proxyDebugPort}:${debugPort} ${appPort ? proxyResult.proxyAppPort + ":" + appPort : ""}`); - + // Wait for the port-forward proxy to be ready. kubeChannel.showOutput("Waiting for port forwarding to be ready..."); await this.waitForProxyReady(proxyResult.proxyProcess); diff --git a/src/debug/providerRegistry.ts b/src/debug/providerRegistry.ts index 72344f8be..e1f987fda 100644 --- a/src/debug/providerRegistry.ts +++ b/src/debug/providerRegistry.ts @@ -15,7 +15,7 @@ async function showProviderPick(): Promise { provider }; }); - + const pickedProvider = await vscode.window.showQuickPick( providerItems, { placeHolder: "Select the environment" }); if (!pickedProvider) { return null; diff --git a/src/docker/dockerUtils.ts b/src/docker/dockerUtils.ts index 5df36b1f2..38fb84ef5 100644 --- a/src/docker/dockerUtils.ts +++ b/src/docker/dockerUtils.ts @@ -16,7 +16,7 @@ export enum DockerClient { /** * Build the docker image first. If imagePrefix is not empty, push the image to remote docker hub, too. - * + * * @param dockerClient the possible dockerClient: docker or docker-compose. * @param shellOpts any option available to Node.js's child_process.exec(). * @param imagePrefix the image prefix for docker images (e.g. 'docker.io/brendanburns'). @@ -86,7 +86,7 @@ export async function resolveKubernetesDockerEnv(kubectl: Kubectl): Promise<{}> if (!currentCluster || !currentCluster.server || !currentCluster.certificateAuthority) { return {}; } - + if (/^https/.test(currentCluster.server)) { dockerEnv["DOCKER_TLS_VERIFY"] = 1; } diff --git a/src/extension.ts b/src/extension.ts index 96333f1ff..b11c0edc7 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -100,7 +100,7 @@ export async function activate(context): Promise { ]; const draftDebugProvider = new DraftConfigurationProvider(); - let draftDebugSession: vscode.DebugSession; + let draftDebugSession: vscode.DebugSession; const subscriptions = [ @@ -217,7 +217,7 @@ export async function activate(context): Promise { } } }); - + vscode.debug.onDidTerminateDebugSession((e) => { // if there is an active Draft debugging session, restart the cycle diff --git a/src/extensionUtils.ts b/src/extensionUtils.ts index 7eb888b43..ea9b75174 100644 --- a/src/extensionUtils.ts +++ b/src/extensionUtils.ts @@ -5,7 +5,7 @@ import { shell, ShellResult } from "./shell"; /** * Install a vscode extension programmatically. - * + * * @param extensionId the extension id. */ export async function installVscodeExtension(extensionId: string): Promise { diff --git a/src/helm.completionProvider.ts b/src/helm.completionProvider.ts index e85f30462..6f3434be2 100644 --- a/src/helm.completionProvider.ts +++ b/src/helm.completionProvider.ts @@ -8,7 +8,7 @@ import * as _ from 'lodash'; import {existsSync} from 'fs'; export class HelmTemplateCompletionProvider implements vscode.CompletionItemProvider { - + private valuesMatcher = new RegExp('\\s+\\.Values\\.([a-zA-Z0-9\\._-]+)?$'); private funcmap = new FuncMap(); @@ -96,7 +96,7 @@ export class HelmTemplateCompletionProvider implements vscode.CompletionItemProv logger.helm.log(err.message); return []; } - + // If this does not match the valuesMatcher (Not a .Values.SOMETHING...) then // we return right away. if (!res || res.length == 0) { diff --git a/src/helm.documentProvider.ts b/src/helm.documentProvider.ts index 32e07a32c..b7f9557dc 100644 --- a/src/helm.documentProvider.ts +++ b/src/helm.documentProvider.ts @@ -40,7 +40,7 @@ export class HelmInspectDocumentProvider implements vscode.TextDocumentContentPr exec.helmExec(`inspect values "${path}"`, printer); }); }); - + } } @@ -89,11 +89,11 @@ export class HelmTemplatePreviewDocumentProvider implements vscode.TextDocumentC vscode.window.showErrorMessage(`YAML failed to parse: ${ e.message }`); } } - + resolve(previewBody(reltpl, out)); }); }); }); - + } } \ No newline at end of file diff --git a/src/helm.funcmap.ts b/src/helm.funcmap.ts index 80cee3f19..faf024d2f 100644 --- a/src/helm.funcmap.ts +++ b/src/helm.funcmap.ts @@ -27,7 +27,7 @@ export class FuncMap { ] } public releaseVals(): vscode.CompletionItem[] { - return [ + return [ this.v("Name", ".Release.Name", "Name of the release"), this.v("Time", ".Release.Time", "Time of the release"), this.v("Namespace", ".Release.Namespace", "Default namespace of the release"), @@ -144,7 +144,7 @@ export class FuncMap { this.f("cat", "cat $str1 $str2 ...", "concatenate all given strings into one, separated by spaces"), this.f("indent", "indent $count $str", "indent $str with $count space chars on the left"), this.f("replace", "replace $find $replace $str", "find $find and replace with $replace"), - + // String list this.f("plural", "plural $singular $plural $count", "if $count is 1, return $singular, else return $plural"), this.f("join", "join $sep $str1 $str2 ...", "concatenate all given strings into one, separated by $sep"), diff --git a/src/helm.resources.ts b/src/helm.resources.ts index b69bdbdf9..e80d9539a 100644 --- a/src/helm.resources.ts +++ b/src/helm.resources.ts @@ -84,7 +84,7 @@ export class Resources { }); }); return res; - } + } } function d(name: string, use: string, doc: string): vscode.CompletionItem { diff --git a/src/kubectlUtils.ts b/src/kubectlUtils.ts index 805b9fd67..06287f229 100644 --- a/src/kubectlUtils.ts +++ b/src/kubectlUtils.ts @@ -202,7 +202,7 @@ export async function switchNamespace(kubectl: Kubectl, namespace: string): Prom /** * Run the specified image in the kubernetes cluster. - * + * * @param kubectl the kubectl client. * @param deploymentName the deployment name. * @param image the docker image. @@ -234,7 +234,7 @@ export async function runAsDeployment(kubectl: Kubectl, deploymentName: string, /** * Query the pod list for the specified label. - * + * * @param kubectl the kubectl client. * @param labelQuery the query label. * @return the pod list. @@ -253,7 +253,7 @@ export async function findPodsByLabel(kubectl: Kubectl, labelQuery: string): Pro /** * Wait and block until the specified pod's status becomes running. - * + * * @param kubectl the kubectl client. * @param podName the pod name. */ @@ -273,7 +273,7 @@ export async function waitForRunningPod(kubectl: Kubectl, podName: string): Prom Pod logs:\n${logsResult.code === 0 ? logsResult.stdout : logsResult.stderr}`); throw new Error(`Failed to start the pod "${podName}". Its status is "${status}".`); } - + await sleep(1000); } } diff --git a/test/kubectl.test.ts b/test/kubectl.test.ts index 59981ed7f..bd1ff658f 100644 --- a/test/kubectl.test.ts +++ b/test/kubectl.test.ts @@ -177,7 +177,7 @@ suite("kubectl tests", () => { test("...we do not attempt to call kubectl", async () => { let kubectlInvoked = false; const kubectl = kubectlCreateWithFakes({ - shell: fakes.shell({execCallback: (cmd) => { + shell: fakes.shell({execCallback: (cmd) => { if (cmd.startsWith('kubectl')) { kubectlInvoked = true; } return { code: 98765, stdout: '', stderr: '' }; } }) @@ -195,7 +195,7 @@ suite("kubectl tests", () => { const kubectl = kubectlCreateWithFakes({ shell: fakes.shell({ recognisedCommands: [{command: 'where.exe kubectl.exe', code: 0, stdout: 'c:\\kubectl.exe'}], - execCallback: (cmd) => { + execCallback: (cmd) => { if (cmd.startsWith('kubectl')) { kubectlInvoked = true; } return { code: 98765, stdout: '', stderr: '' }; } @@ -210,7 +210,7 @@ suite("kubectl tests", () => { const kubectl = kubectlCreateWithFakes({ host: fakes.host({configuration: kcFakePathConfig()}), shell: fakes.shell({ - execCallback: (cmd) => { + execCallback: (cmd) => { invoked.push(cmd); return { code: 98765, stdout: '', stderr: '' }; } @@ -232,7 +232,7 @@ suite("kubectl tests", () => { const kubectl = kubectlCreateWithFakes({ shell: fakes.shell({ recognisedCommands: [{command: 'where.exe kubectl.exe', code: 0, stdout: 'c:\\kubectl.exe'}], - execCallback: (cmd) => { + execCallback: (cmd) => { if (cmd.startsWith('kubectl')) { kubectlCommandLine = cmd; } return { code: 98765, stdout: '', stderr: '' }; } @@ -248,7 +248,7 @@ suite("kubectl tests", () => { const kubectl = kubectlCreateWithFakes({ shell: fakes.shell({ recognisedCommands: [{command: 'where.exe kubectl.exe', code: 0, stdout: 'c:\\kubectl.exe'}], - execCallback: (cmd) => { + execCallback: (cmd) => { if (cmd.startsWith('kubectl')) { return fakeKubectlResult; } return { code: 98765, stdout: '', stderr: '' }; } @@ -269,7 +269,7 @@ suite("kubectl tests", () => { host: fakes.host({errors: errors, warnings: warnings, infos: infos}), shell: fakes.shell({ recognisedCommands: [{command: 'where.exe kubectl.exe', code: 0, stdout: 'c:\\kubectl.exe'}], - execCallback: (cmd) => { + execCallback: (cmd) => { if (cmd.startsWith('kubectl')) { return fakeKubectlResult; } return { code: 98765, stdout: '', stderr: '' }; } @@ -291,7 +291,7 @@ suite("kubectl tests", () => { host: fakes.host({errors: errors, warnings: warnings, infos: infos}), shell: fakes.shell({ recognisedCommands: [{command: 'where.exe kubectl.exe', code: 0, stdout: 'c:\\kubectl.exe'}], - execCallback: (cmd) => { + execCallback: (cmd) => { if (cmd.startsWith('kubectl')) { return fakeKubectlResult; } return { code: 98765, stdout: '', stderr: '' }; } diff --git a/tslint.json b/tslint.json index bd7becd3f..30df57205 100644 --- a/tslint.json +++ b/tslint.json @@ -26,6 +26,7 @@ "property-declaration": "onespace", "variable-declaration": "onespace" } - ] + ], + "no-trailing-whitespace": true } } \ No newline at end of file