Skip to content

Commit

Permalink
eslint and doc fix
Browse files Browse the repository at this point in the history
  • Loading branch information
matepek committed Dec 16, 2023
1 parent 35bc4a9 commit 3f815cd
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 15 deletions.
3 changes: 0 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,5 @@
"background": "yellow"
}
},
"[xml]": {
"editor.defaultFormatter": "DotJoshJohnson.xml"
},
"task.allowAutomaticTasks": "on"
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Not good enough for you?!: Edit your `.vscode/`[settings.json] file according to
| `discovery.loadOnStartup` | If true, the extension will try to load all the tests after the startup. Otherwise the user has to click on the Test icon on the sidebar to trigger the process. |
| `discovery.gracePeriodForMissing` | [seconds] Test executables are being watched (only inside the workspace directory). In case of one recompiles it will try to preserve the test states. If compilation reaches timeout it will drop the suite. |
| `discovery.runtimeLimit` | [seconds] The timeout of the test-executable used to identify it (Calls the exec with `--help`). |
| `discovery.testListCaching` | (Experimental) In case your executable took too much time to list the tests, one can set this. It will preserve the output of `--gtest_list_tests --gtest_output=xml:...`. (Beware: Older Google Test doesn't support xml test list format.) |
| `discovery.testListCaching` | In case your executable took too much time to list the tests, one can set this. It will preserve the output of `--gtest_list_tests --gtest_output=xml:...`. (Beware: Older Google Test doesn't support xml test list format.) |
| `discovery.strictPattern` | Test loading fails if one of the files matched by `test.executable` is not a test executable. (Helps noticing unexpected crashes/problems under test loading.) |
| [debug.configTemplate] | Sets the necessary debug configurations and the debug button will work. |
| `debug.breakOnFailure` | Debugger breaks on failure while debugging the test. Catch2: [--break](https://github.com/catchorg/Catch2/blob/master/docs/command-line.md#breaking-into-the-debugger); Google Test: [--gtest_break_on_failure](https://github.com/google/googletest/blob/master/googletest/docs/advanced.md#turning-assertion-failures-into-break-points); Doctest: [--no-breaks](https://github.com/onqtam/doctest/blob/master/doc/markdown/commandline.md) |
Expand Down
6 changes: 5 additions & 1 deletion src/Question.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { request } from 'https';
import * as vscode from 'vscode';

export class Question {
constructor(id: number, readonly message: string, ...items: { text: string; link: string | undefined }[]) {
constructor(
id: number,
readonly message: string,
...items: { text: string; link: string | undefined }[]
) {
this.items = items;
}

Expand Down
5 changes: 4 additions & 1 deletion src/RunningExecutable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ export enum ExecutableRunResultValue {
///

export class ExecutableRunResult {
private constructor(readonly value: ExecutableRunResultValue, private readonly _error: string | undefined) {}
private constructor(
readonly value: ExecutableRunResultValue,
private readonly _error: string | undefined,
) {}

get Ok(): boolean {
return this.value === ExecutableRunResultValue.OK;
Expand Down
5 changes: 4 additions & 1 deletion src/Spawner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ export class SpawnWithExecutor extends DefaultSpawner {
private readonly _argsR2 = '${argsFlat}';
private readonly _argsStrR = '${argsStr}';

constructor(private readonly _executor: string, private readonly _args?: ReadonlyArray<string>) {
constructor(
private readonly _executor: string,
private readonly _args?: ReadonlyArray<string>,
) {
super();

if (_args && !_args.some(x => x.indexOf(this._cmdR) != -1)) {
Expand Down
6 changes: 5 additions & 1 deletion src/Util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ export class Version {
return new Version(Number(major), minor ? Number(minor) : undefined, patch ? Number(patch) : undefined);
}

constructor(readonly major: number, private readonly _minor?: number, private readonly _patch?: number) {}
constructor(
readonly major: number,
private readonly _minor?: number,
private readonly _patch?: number,
) {}

get minor(): number {
return this._minor ? this._minor : 0;
Expand Down
5 changes: 4 additions & 1 deletion src/framework/Catch2/Catch2Executable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ import { pipeOutputStreams2Parser, pipeOutputStreams2String, pipeProcess2Parser
import { Readable } from 'stream';

export class Catch2Executable extends AbstractExecutable<Catch2Test> {
constructor(sharedVarOfExec: SharedVarOfExec, private readonly _catch2Version: Version | undefined) {
constructor(
sharedVarOfExec: SharedVarOfExec,
private readonly _catch2Version: Version | undefined,
) {
super(sharedVarOfExec, 'Catch2', _catch2Version);
}

Expand Down
5 changes: 4 additions & 1 deletion src/framework/Framework.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ export type FrameworkType = 'catch2' | 'gtest' | 'doctest' | 'gbenchmark';
export type FrameworkId = FrameworkType | 'google-insider';

export class Framework {
constructor(readonly id: FrameworkId, readonly type: FrameworkType) {
constructor(
readonly id: FrameworkId,
readonly type: FrameworkType,
) {
this.testTag = new vscode.TestTag(`framework.${type}`);
}

Expand Down
10 changes: 8 additions & 2 deletions src/framework/GoogleTest/GoogleTestExecutable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ import { pipeOutputStreams2Parser, pipeOutputStreams2String, pipeProcess2Parser
import { Readable } from 'stream';

export class GoogleTestExecutable extends AbstractExecutable<GoogleTestTest> {
constructor(sharedVarOfExec: SharedVarOfExec, private readonly _argumentPrefix: string) {
constructor(
sharedVarOfExec: SharedVarOfExec,
private readonly _argumentPrefix: string,
) {
super(sharedVarOfExec, 'GoogleTest', undefined);
}

Expand Down Expand Up @@ -376,7 +379,10 @@ const testEndRe = (testId: string) =>
///

class TestCaseSharedData {
constructor(readonly shared: SharedVarOfExec, readonly builder: TestResultBuilder) {}
constructor(
readonly shared: SharedVarOfExec,
readonly builder: TestResultBuilder,
) {}

gMockWarningCount = 0;
}
Expand Down
5 changes: 4 additions & 1 deletion src/util/TaskQueue.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
export class TaskQueue {
constructor(depends: Iterable<TaskQueue> = [], readonly name?: string) {
constructor(
depends: Iterable<TaskQueue> = [],
readonly name?: string,
) {
for (const dep of depends) {
this._checkCircle(dep);
this._depends.push(dep);
Expand Down
6 changes: 5 additions & 1 deletion src/util/TextStreamParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import { debugBreak } from './DevelopmentHelper';
import { ParserInterface } from './ParserInterface';

export class TextStreamParser implements ParserInterface {
constructor(private readonly log: Logger, rootProcessor: RootLineProcessor, private readonly handleStdErr = true) {
constructor(
private readonly log: Logger,
rootProcessor: RootLineProcessor,
private readonly handleStdErr = true,
) {
this.topProcessor = rootProcessor;
}

Expand Down
6 changes: 5 additions & 1 deletion src/util/XmlParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ export class XmlParser implements ParserInterface {
private readonly xmlTagProcessorStack: ProcessorFrame[] = [];
private topTagProcessor: ProcessorFrame;

constructor(private readonly log: Logger, processor: XmlTagProcessor, onerrorCb: (error: Error) => void) {
constructor(
private readonly log: Logger,
processor: XmlTagProcessor,
onerrorCb: (error: Error) => void,
) {
{
let resolver: () => void;
this.endP = new Promise<void>(resolve => (resolver = resolve));
Expand Down

0 comments on commit 3f815cd

Please sign in to comment.