Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
},
"overrides": [
{
"files": ["**/*.test.ts", "**/test/**"],
"files": ["**/*.test.ts", "**/test/**", "**/*.integ.ts"],
"rules": {
"no-console": "off"
"no-console": "off",
"@typescript-eslint/no-unused-expressions": "off"
}
},
{
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
"packageManager": "yarn@3.2.1",
"devDependencies": {
"@types/node": "^22.0.0",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@typescript-eslint/eslint-plugin": "^8.62.0",
"@typescript-eslint/parser": "^8.62.0",
"conventional-changelog-cli": "^4.1.0",
"eslint": "^8.55.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-no-only-tests": "^3.1.0",
"ts-mockito": "^2.6.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/databricks-vscode-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"devDependencies": {
"@types/vscode": "1.86.0",
"eslint": "^8.55.0",
"eslint": "^8.57.0",
"prettier": "^3.1.1",
"typescript": "^5.3.3"
},
Expand Down
9 changes: 5 additions & 4 deletions packages/databricks-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1571,14 +1571,15 @@
"@types/mocha": "^10.0.6",
"@types/mock-require": "^2.0.3",
"@types/node": "^22.0.0",
"@types/semver": "^7.5.0",
"@types/sinonjs__fake-timers": "^8.1.5",
"@types/tmp": "^0.2.6",
"@types/triple-beam": "^1.3.5",
"@types/vscode": "1.86.0",
"@types/yargs": "^17.0.32",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@typescript-eslint/utils": "^6.14.0",
"@typescript-eslint/eslint-plugin": "^8.62.0",
"@typescript-eslint/parser": "^8.62.0",
"@typescript-eslint/utils": "^8.62.0",
"@vscode/test-electron": "^2.3.8",
"@wdio/cli": "^9.29.0",
"@wdio/local-runner": "^9.29.0",
Expand All @@ -1587,7 +1588,7 @@
"@wdio/types": "^9.29.0",
"chai": "^4.3.10",
"esbuild": "^0.25.0",
"eslint": "^8.55.0",
"eslint": "^8.57.0",
"eslint-plugin-local-rules": "^2.0.1",
"extract-zip": "^2.0.1",
"fs-extra": "^11.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export class BundlePipelinesManager {
return this.connectionManager.syncDestinationMapper?.remoteToLocal(
new RemoteUri(remotePath)
);
} catch (e) {
} catch {
return undefined;
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/databricks-vscode/src/cli/CliWrapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const cliPath = path.join(
(process.platform === "win32" ? "databricks.exe" : "databricks")
);

// eslint-disable-next-line @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-require-imports
const extensionVersion = require("../../package.json").version;

function getTempLogFilePath() {
Expand Down
6 changes: 3 additions & 3 deletions packages/databricks-vscode/src/configuration/LoginWizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ export async function saveNewProfile(
let shouldBackup = true;
try {
await stat(configFilePath);
} catch (e) {
} catch {
shouldBackup = false;
await createFile(configFilePath);
window.showInformationMessage(
Expand Down Expand Up @@ -450,15 +450,15 @@ export async function listProfiles(cliWrapper: CliWrapper) {
const cfgPath = FileUtils.getDatabricksConfigFilePath().fsPath;
try {
await stat(cfgPath);
} catch (e) {
} catch {
return [];
}
const allProfiles = await cliWrapper.listProfiles(cfgPath);
const profiles = allProfiles.filter((profile) => {
try {
UrlUtils.normalizeHost(profile.host!.toString());
return true;
} catch (e) {
} catch {
return false;
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {CancellationToken, ProgressLocation, window} from "vscode";
import {normalizeHost} from "../../utils/urlUtils";
import {workspaceConfigs} from "../../vscode-objs/WorkspaceConfigs";

// eslint-disable-next-line @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-require-imports
const extensionVersion = require("../../../package.json")
.version as ProductVersion;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
// eslint-disable-next-line @typescript-eslint/naming-convention
const {NamedLogger} = logging;

// eslint-disable-next-line @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-require-imports
const extensionVersion = require("../../../package.json")
.version as ProductVersion;

Expand Down Expand Up @@ -280,7 +280,7 @@ export class AzureCliCheck implements Disposable {
if (stdout.indexOf("azure-cli") !== -1) {
return true;
}
} catch (e) {
} catch {
return false;
}
return false;
Expand Down Expand Up @@ -331,7 +331,7 @@ export class AzureCliCheck implements Disposable {
if (stderr.indexOf("az login") !== -1) {
return false;
}
} catch (e) {
} catch {
return false;
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {orchestrate, OrchestrationLoopError, Step} from "./orchestrate";
import {Loggers} from "../../logger";
import {execFile} from "../../cli/CliWrapper";

// eslint-disable-next-line @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-require-imports
const extensionVersion = require("../../../package.json")
.version as ProductVersion;

Expand Down Expand Up @@ -131,7 +131,7 @@ export class DatabricksCliCheck implements Disposable {
await workspaceClient.currentUser.me(
new Context({cancellationToken})
);
} catch (e: any) {
} catch {
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/databricks-vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ import {
} from "./ui/unity-catalog/UnityCatalogTreeDataProvider";
import {registerDetailPanel} from "./ui/unity-catalog/registerDetailPanel";

// eslint-disable-next-line @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-require-imports
const packageJson = require("../package.json");

const customWhenContext = new CustomWhenContext();
Expand Down Expand Up @@ -342,7 +342,7 @@ export async function activate(
() => {
try {
return workspaceFolderManager.activeProjectUri.fsPath;
} catch (e) {
} catch {
return undefined;
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export class DatabricksEnvFileManager implements Disposable {
}
try {
await stat(this.userEnvPath.fsPath);
} catch (err) {
} catch {
logging.NamedLogger.getOrCreate(Loggers.Extension).debug(
`${this.userEnvPath.fsPath} does not exist. Not loading user env vars and continuing.`
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class ConfigureAutocomplete implements Disposable {
try {
const stats = await stat(builtinsPath);
builtinsFileExists = stats.isFile();
} catch (e) {
} catch {
builtinsFileExists = false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export class MsPythonExtensionWrapper implements Disposable {
try {
await execFile("uv", ["--version"]);
return fs.existsSync(path.join(this.projectRoot, "uv.lock"));
} catch (error) {
} catch {
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function isDbnbTextEditor(editor?: TextEditor) {
(await FileUtils.isNotebook(new LocalUri(editor.document.uri))) ===
"PY_DBNB"
);
} catch (e) {
} catch {
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/databricks-vscode/src/logger/LoggerManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class LoggerManager {
try {
await access(logFile);
await unlink(logFile);
} catch (e) {}
} catch {}

return logFile;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/databricks-vscode/src/run/DatabricksRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export class DatabricksRuntime implements Disposable {
localFile
);
}
} catch (e) {}
} catch {}

this._onDidSendOutputEmitter.fire({
type: "out",
Expand Down
4 changes: 3 additions & 1 deletion packages/databricks-vscode/src/sdk-extensions/Repos.integ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ describe(__filename, function () {

setTimeout(() => {
token.isCancellationRequested = true;
listener && listener();
if (listener) {
listener();
}
}, 100);

// reponse should finish soon after cancellation
Expand Down
8 changes: 6 additions & 2 deletions packages/databricks-vscode/src/sdk-extensions/WorkflowRun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ export class WorkflowRun {
const run = await this.submitRun(client, submitRunOptions);
await run.wait(onProgress, token);
const output = await run.getOutput();
onProgress && onProgress(run.lifeCycleState!, run);
if (onProgress) {
onProgress(run.lifeCycleState!, run);
}
return output;
}

Expand Down Expand Up @@ -156,7 +158,9 @@ export class WorkflowRun {
return;
}
await this.update();
onProgress && onProgress(this.lifeCycleState!, this);
if (onProgress) {
onProgress(this.lifeCycleState!, this);
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/databricks-vscode/src/sync/SyncDestination.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {WorkspaceClient, logging} from "@databricks/sdk-experimental";
import {WorkspaceFsEntity, WorkspaceFsUtils} from "../sdk-extensions";
import path = require("path");
import * as path from "path";
import {Uri} from "vscode";
import {Loggers} from "../logger";
import {ConnectionManager} from "../configuration/ConnectionManager";
Expand Down
2 changes: 1 addition & 1 deletion packages/databricks-vscode/src/telemetry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function getTelemetryReporter(): TelemetryReporter | undefined {
// If we cannot initialize the telemetry reporter, don't break the entire extension.
try {
return new TelemetryReporter(getTelemetryKey());
} catch (e) {
} catch {
return undefined;
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/databricks-vscode/src/test/e2e/destroy.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe("Deploy and destroy", async function () {
logs.includes("Bundle deployed successfully") &&
logs.includes("Bundle configuration refreshed")
);
} catch (e) {
} catch {
return false;
}
},
Expand Down Expand Up @@ -164,7 +164,7 @@ describe("Deploy and destroy", async function () {
logs.includes("Bundle destroyed successfully") &&
logs.includes("Bundle configuration refreshed")
);
} catch (e) {
} catch {
return false;
}
},
Expand Down
4 changes: 2 additions & 2 deletions packages/databricks-vscode/src/test/e2e/utils/commonUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export async function waitForWorkflowWebview(
try {
const webView = await workbench.getWebviewByTitle(title);
return webView !== undefined;
} catch (e) {
} catch {
return false;
}
},
Expand Down Expand Up @@ -385,7 +385,7 @@ export async function waitForDeployment() {
logs.includes("Bundle deployed successfully") &&
logs.includes("Bundle configuration refreshed")
);
} catch (e) {
} catch {
return false;
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export type BundleResourceExplorerResource<
K extends BundleResourceExplorerResourceKey,
> = Resource<BundleRemoteState, K>;

export interface BundleResourceExplorerTreeItem extends TreeItem {}
export type BundleResourceExplorerTreeItem = TreeItem;

export interface BundleResourceExplorerTreeNode {
type:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class VariableTreeNode implements BundleVariableTreeNode {
complexValueToString(value: any) {
try {
return JSON.stringify(value);
} catch (error) {
} catch {
return "complex vairable";
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {TreeItem} from "vscode";
import {BundleVariable} from "../../bundle/models/BundleVariableModel";

export interface BundleVariableTreeItem extends TreeItem {}
export type BundleVariableTreeItem = TreeItem;

export interface BundleVariableTreeNode {
readonly key?: string;
Expand Down
4 changes: 2 additions & 2 deletions packages/databricks-vscode/src/utils/DateUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe("DateUtils", () => {
// Fallback to a different locale check so we can run these tests on different machines
try {
expect(result).to.equal("5 Oct, 2023 14:48:00");
} catch (e) {
} catch {
expect(result).to.equal("5 Oct, 2023 2:48:00 PM");
}
});
Expand All @@ -29,7 +29,7 @@ describe("DateUtils", () => {
const result = toTimeString(date);
try {
expect(result).to.equal("14:48:00");
} catch (e) {
} catch {
expect(result).to.equal("2:48:00 PM");
}
});
Expand Down
2 changes: 1 addition & 1 deletion packages/databricks-vscode/src/utils/envVarGenerators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {logging, Headers} from "@databricks/sdk-experimental";
import {ConnectionManager} from "../configuration/ConnectionManager";
import {TerraformMetadata} from "./terraformUtils";

// eslint-disable-next-line @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-require-imports
const packageJson = require("../../package.json");

const extensionVersion = packageJson.version;
Expand Down
2 changes: 1 addition & 1 deletion packages/databricks-vscode/src/utils/fileUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export async function expandUriAndType(localUri?: LocalUri): Promise<{
await stat(check.uri.fsPath);
check.type = await isNotebook(new LocalUri(check.uri));
return check;
} catch (e) {}
} catch {}
}
return {};
}
Expand Down
2 changes: 1 addition & 1 deletion packages/databricks-vscode/src/utils/onErrorDecorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function onError(props: OnErrorProps) {
},
};
}
} catch (e) {}
} catch {}
}
const originalMethod = descriptor.value;

Expand Down
Loading
Loading