From 3ea5aaa61d64d1be5a7fa501063116a1bd9cb52e Mon Sep 17 00:00:00 2001 From: Mats Larsen Date: Wed, 6 Nov 2024 13:45:44 +0900 Subject: [PATCH] Apply manual fixes --- .idea/prettier.xml | 8 -------- lib/compilers/fake-for-test.ts | 4 ++-- lib/execution/base-execution-env.ts | 24 +++++++++++------------- static/options.ts | 1 + test/handlers/asm-docs-tests.ts | 2 +- 5 files changed, 15 insertions(+), 24 deletions(-) delete mode 100644 .idea/prettier.xml diff --git a/.idea/prettier.xml b/.idea/prettier.xml deleted file mode 100644 index 60c07b5ac..000000000 --- a/.idea/prettier.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - \ No newline at end of file diff --git a/lib/compilers/fake-for-test.ts b/lib/compilers/fake-for-test.ts index 0ac21db74..a251d75e3 100644 --- a/lib/compilers/fake-for-test.ts +++ b/lib/compilers/fake-for-test.ts @@ -28,6 +28,7 @@ import {BypassCache, ExecutionParams, FiledataPair} from '../../types/compilatio import type {ICompiler, PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js'; import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js'; import {SelectedLibraryVersion} from '../../types/libraries/libraries.interfaces.js'; +import {BaseCompiler} from '../base-compiler.js'; import {CompilerArguments} from '../compiler-arguments.js'; export class FakeCompiler implements ICompiler { @@ -54,9 +55,8 @@ export class FakeCompiler implements ICompiler { this.possibleArguments = new CompilerArguments('fake-for-test'); } - initialise(mtime: Date, clientOptions: any, isPrediscovered: boolean) { + initialise(mtime: Date, clientOptions: any, isPrediscovered: boolean): Promise { throw new Error('Method not implemented.'); - return Promise.resolve(null); } getInfo() { diff --git a/lib/execution/base-execution-env.ts b/lib/execution/base-execution-env.ts index 0485e567b..1f83a72da 100644 --- a/lib/execution/base-execution-env.ts +++ b/lib/execution/base-execution-env.ts @@ -124,7 +124,7 @@ export class LocalExecutionEnvironment implements IExecutionEnvironment { packageDownloadAndUnzipTime: utils.deltaTimeNanoToMili(startTime, endTime), }); } - throw new ExecutablePackageCacheMiss('Tried to get executable from cache, but got a cache miss'); + throw new ExecutablePackageCacheMiss('Tried to get executable from cache, but got a cache miss'); } async downloadExecutablePackage(hash: string): Promise { @@ -146,9 +146,7 @@ export class LocalExecutionEnvironment implements IExecutionEnvironment { } } - if ( - this.buildResult?.defaultExecOptions?.env?.PATH - ) { + if (this.buildResult?.defaultExecOptions?.env?.PATH) { if (env.PATH.length > 0) env.PATH = env.PATH + path.delimiter + this.buildResult.defaultExecOptions.env.PATH; else env.PATH = this.buildResult.defaultExecOptions.env.PATH; @@ -241,16 +239,16 @@ export class LocalExecutionEnvironment implements IExecutionEnvironment { executeParameters, homeDir, ); - } catch (err: UnprocessedExecResult | any) { + } catch (err: any) { if (err.code && err.stderr) { return utils.processExecutionResult(err); } - return { - ...utils.getEmptyExecutionResult(), - stdout: err.stdout ? utils.parseOutput(err.stdout) : [], - stderr: err.stderr ? utils.parseOutput(err.stderr) : [], - code: err.code === undefined ? -1 : err.code, - }; + return { + ...utils.getEmptyExecutionResult(), + stdout: err.stdout ? utils.parseOutput(err.stdout) : [], + stderr: err.stderr ? utils.parseOutput(err.stderr) : [], + code: err.code === undefined ? -1 : err.code, + }; } } @@ -330,8 +328,8 @@ export class LocalExecutionEnvironment implements IExecutionEnvironment { return processed; } - const execResult: UnprocessedExecResult = await exec.sandbox(executable, args, execOptions); - return this.processUserExecutableExecutionResult(execResult, Array.from(lineParseOptions.values())); + const execResult: UnprocessedExecResult = await exec.sandbox(executable, args, execOptions); + return this.processUserExecutableExecutionResult(execResult, Array.from(lineParseOptions.values())); } processUserExecutableExecutionResult( diff --git a/static/options.ts b/static/options.ts index 5086c9fe7..fc8bc5330 100644 --- a/static/options.ts +++ b/static/options.ts @@ -38,6 +38,7 @@ for (const key in extraOptions) { window.compilerExplorerOptions[key] = extraOptions[key as keyof typeof extraOptions]; } +// biome-ignore lint/style/useConst: can't use const here declare let __webpack_public_path__: string; // eslint-disable-next-line prefer-const diff --git a/test/handlers/asm-docs-tests.ts b/test/handlers/asm-docs-tests.ts index 1c20a1f90..385eea45d 100644 --- a/test/handlers/asm-docs-tests.ts +++ b/test/handlers/asm-docs-tests.ts @@ -29,7 +29,7 @@ import {beforeAll, describe, expect, it} from 'vitest'; import {withAssemblyDocumentationProviders} from '../../lib/handlers/assembly-documentation.js'; /** Test matrix of architecture to [opcode, tooptip, html, url] */ -export const TEST_MATRIX: Record = { +const TEST_MATRIX: Record = { 6502: [ [ 'lda',