Fix lint/style issues
[?]
Dec 23, 2020, 10:23 PM
4PN3R2LY3SJGMP2HFAR7MBSFWOG633FSN2FEIQEZREDZVI4JB76QCDependencies
- [2]
TKKT6D4CAdd failure loop to installation selection - [3]
WW67NYZVConfigure eslint for JS standard formatting - [4]
3N3RS66TCreate pijul output channel and configure activation events - [5]
NCBEWRYEInitialize Repository - [6]
WHFIIX4YImprove documentation and add Pijul installation configuration
Change contents
- replacement in src/extension.ts at line 2
import * as cp from "child_process";import * as vscode from "vscode";import * as cp from 'child_process';import * as vscode from 'vscode'; - replacement in src/extension.ts at line 6
path: string;version: string;path: stringversion: string - edit in src/extension.ts at line 10
// TODO: Add lint rule to require function documentation - replacement in src/extension.ts at line 12
if (!path) {if (path == null) { - replacement in src/extension.ts at line 14
if (!config.get<boolean>("ignoreMissingInstallation")) {const selectInstallation = "Select a Pijul Executable";const ignore = "Don't Show this Warning Again";if (!(config.get<boolean>('ignoreMissingInstallation') ?? false)) {const selectInstallation = 'Select a Pijul Executable';const ignore = 'Don\'t Show this Warning Again'; - replacement in src/extension.ts at line 18
"No Pijul installation has been configured for use with the extension. Select one to enable Pijul integration",'No Pijul installation has been configured for use with the extension. Select one to enable Pijul integration', - replacement in src/extension.ts at line 26
if (process.platform === "win32") {if (process.platform === 'win32') { - replacement in src/extension.ts at line 28
svn: ["exe", "bat"]svn: ['exe', 'bat'] - replacement in src/extension.ts at line 40
if (pijulInstallation && pijulInstallation[0]) {if (pijulInstallation?.[0] != null) { - replacement in src/extension.ts at line 42
await config.update("installationPath", exePath);await config.update('installationPath', exePath); - replacement in src/extension.ts at line 44
outputChannel.appendLine("Updated extension configuration to use Pijul installation at " + exePath);outputChannel.appendLine('Updated extension configuration to use Pijul installation at ' + exePath); - replacement in src/extension.ts at line 47
return Promise.reject(new Error("No executable selected in file dialogue"));return await Promise.reject(new Error('No executable selected in file dialogue')); - replacement in src/extension.ts at line 50
await config.update("ignoreMissingInstallation", true);return Promise.reject(new Error("Ignore"));await config.update('ignoreMissingInstallation', true);return await Promise.reject(new Error('Ignore')); - replacement in src/extension.ts at line 55
return Promise.reject(new Error("Ignore"));return await Promise.reject(new Error('Ignore')); - replacement in src/extension.ts at line 59
return new Promise<IPijul>((resolve, reject) => {const pathDefined = path || "pijul";const child = cp.spawn(pathDefined || "pijul", ["--version"]);return await new Promise<IPijul>((resolve, reject) => {const pathDefined = path ?? 'pijul';const child = cp.spawn(pathDefined, ['--version']); - replacement in src/extension.ts at line 63
child.stdout.on("data", (b: Buffer) => buffers.push(b));child.on("error", () => reject(new Error("Error checking version at " + path)));child.on("close", code => {if (code) {reject(new Error("Error checking version at " + path));child.stdout.on('data', (b: Buffer) => buffers.push(b));child.on('error', () => reject(new Error(`Error checking version at ${pathDefined}`)));child.on('close', code => {const tokens = Buffer.concat(buffers).toString('utf8').trim().split(' ');if (code != null || tokens[0] !== 'pijul') {reject(new Error(`Error checking version at ${pathDefined}`)); - replacement in src/extension.ts at line 73
resolve({ path: pathDefined, version: Buffer.concat(buffers).toString("utf8").trim().split(" ")[1] });resolve({ path: pathDefined, version: tokens[1] }); - replacement in src/extension.ts at line 86
async function _activate (_context: vscode.ExtensionContext, config: vscode.WorkspaceConfiguration, disposables: vscode.Disposable[]) {vscode.window.showInformationMessage("Pijul repository detected in workspace, extension has been activated.");console.debug("Pijul VS Code Integration Activated");async function _activate (_context: vscode.ExtensionContext, config: vscode.WorkspaceConfiguration, disposables: vscode.Disposable[]): Promise<void> {await vscode.window.showInformationMessage('Pijul repository detected in workspace, extension has been activated.');console.debug('Pijul VS Code Integration Activated'); - replacement in src/extension.ts at line 90
const outputChannel = vscode.window.createOutputChannel("Pijul");const outputChannel = vscode.window.createOutputChannel('Pijul'); - replacement in src/extension.ts at line 92
disposables.push(vscode.commands.registerCommand("pijul.showOutput", () => outputChannel.show()));disposables.push(vscode.commands.registerCommand('pijul.showOutput', () => outputChannel.show())); - replacement in src/extension.ts at line 94
const installationPath = config.get<string>("installationPath");const installationPath = config.get<string>('installationPath'); - replacement in src/extension.ts at line 98
let pijul;let pijulInfo; - replacement in src/extension.ts at line 101
pijul = await checkPijulInstallation(installationPath, config, outputChannel);outputChannel.appendLine(`Using Pijul ${pijul.version} located at ${pijul.path}`);pijulInfo = await checkPijulInstallation(installationPath, config, outputChannel);outputChannel.appendLine(`Using Pijul ${pijulInfo.version} at ${pijulInfo.path}`); - replacement in src/extension.ts at line 105
if (err.message === "Ignore") {// Complete activation without finding the installationidentifiedInstallation = true;return;} else {// Reset the configuration and try againvscode.window.showErrorMessage(`Failed to find pijul installation at ${err.message.split(" ").pop()}, resetting...`);if (err instanceof Error) {if (err.message === 'Ignore') {// Complete activation without finding the installationidentifiedInstallation = true;return;} else {// Let the user know that the executable didn't work and try againawait vscode.window.showErrorMessage(`Failed to find pijul installation at ${err.message?.split(' ')?.pop() ?? ''}, resetting...`);} - edit in src/extension.ts at line 116
}if (pijulInfo != null) {// const pijul = new Pijul(pijulInfo); - replacement in src/extension.ts at line 139
export async function activate (context: vscode.ExtensionContext) {export async function activate (context: vscode.ExtensionContext): Promise<void> { - replacement in src/extension.ts at line 149
const config = vscode.workspace.getConfiguration("pijul");const enabled = config.get<boolean>("enabled");const config = vscode.workspace.getConfiguration('pijul');const enabled = config.get<boolean>('enabled'); - replacement in src/extension.ts at line 152
if (enabled) {if (enabled ?? false) { - replacement in src/extension.ts at line 163
export function deactivate () { }[3.21678]export function deactivate (): void { } - replacement in src/test/suite/index.ts at line 1
import * as glob from "glob";import * as Mocha from "mocha";import * as path from "path";import * as glob from 'glob';import * as Mocha from 'mocha';import * as path from 'path'; - replacement in src/test/suite/index.ts at line 5
export function run (): Promise<void> {export async function run (): Promise<void> { - replacement in src/test/suite/index.ts at line 8
ui: "tdd",ui: 'tdd', - replacement in src/test/suite/index.ts at line 12
const testsRoot = path.resolve(__dirname, "..");const testsRoot = path.resolve(__dirname, '..'); - replacement in src/test/suite/index.ts at line 14
return new Promise((resolve, reject) => {glob("**/**.test.js", { cwd: testsRoot }, (err, files) => {if (err) {return await new Promise((resolve, reject) => {glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {if (err != null) { - replacement in src/test/suite/extension.test.ts at line 1
import * as assert from "assert";import * as assert from 'assert'; - replacement in src/test/suite/extension.test.ts at line 4
import * as vscode from "vscode";import * as vscode from 'vscode'; - replacement in src/test/suite/extension.test.ts at line 8
suite("Extension Test Suite", () => {vscode.window.showInformationMessage("Start all tests.");suite('Extension Test Suite', () => {// eslint-disable-next-line @typescript-eslint/no-floating-promisesvscode.window.showInformationMessage('Start all tests.'); - replacement in src/test/suite/extension.test.ts at line 12
test("Sample test", () => {test('Sample test', () => { - replacement in src/test/runTest.ts at line 1
import * as path from "path";import * as path from 'path';import { runTests } from 'vscode-test'; - replacement in src/test/runTest.ts at line 4[3.106290]→[3.19037:19077](∅→∅),[3.19077]→[3.106330:106331](∅→∅),[3.106330]→[3.106330:106331](∅→∅),[3.106331]→[3.19078:19103](∅→∅)
import { runTests } from "vscode-test";async function main () {async function main (): Promise<void> { - replacement in src/test/runTest.ts at line 8
const extensionDevelopmentPath = path.resolve(__dirname, "../../");const extensionDevelopmentPath = path.resolve(__dirname, '../../'); - replacement in src/test/runTest.ts at line 12
const extensionTestsPath = path.resolve(__dirname, "./suite/index");const extensionTestsPath = path.resolve(__dirname, './suite/index'); - replacement in src/test/runTest.ts at line 17
console.error("Failed to run tests");console.error('Failed to run tests'); - edit in src/test/runTest.ts at line 22
// eslint-disable-next-line @typescript-eslint/no-floating-promises