diff --git a/simple-git/src/lib/errors/git-construct-error.ts b/simple-git/src/lib/errors/git-construct-error.ts index ec29f76e..e871787a 100644 --- a/simple-git/src/lib/errors/git-construct-error.ts +++ b/simple-git/src/lib/errors/git-construct-error.ts @@ -11,7 +11,10 @@ import { SimpleGitOptions } from '../types'; * passed to the constructor. */ export class GitConstructError extends GitError { - constructor(public readonly config: SimpleGitOptions, message: string) { + constructor( + public readonly config: SimpleGitOptions, + message: string + ) { super(undefined, message); } } diff --git a/simple-git/src/lib/errors/git-error.ts b/simple-git/src/lib/errors/git-error.ts index 00f2ad5d..2d50ca4f 100644 --- a/simple-git/src/lib/errors/git-error.ts +++ b/simple-git/src/lib/errors/git-error.ts @@ -26,7 +26,10 @@ import type { SimpleGitTask } from '../types'; ``` */ export class GitError extends Error { - constructor(public task?: SimpleGitTask, message?: string) { + constructor( + public task?: SimpleGitTask, + message?: string + ) { super(message); Object.setPrototypeOf(this, new.target.prototype); } diff --git a/simple-git/src/lib/parsers/parse-list-log-summary.ts b/simple-git/src/lib/parsers/parse-list-log-summary.ts index bbb6bcd6..d6c7bed3 100644 --- a/simple-git/src/lib/parsers/parse-list-log-summary.ts +++ b/simple-git/src/lib/parsers/parse-list-log-summary.ts @@ -12,10 +12,13 @@ export const SPLITTER = ' ò '; const defaultFieldNames = ['hash', 'date', 'message', 'refs', 'author_name', 'author_email']; function lineBuilder(tokens: string[], fields: string[]): any { - return fields.reduce((line, field, index) => { - line[field] = tokens[index] || ''; - return line; - }, Object.create({ diff: null }) as any); + return fields.reduce( + (line, field, index) => { + line[field] = tokens[index] || ''; + return line; + }, + Object.create({ diff: null }) as any + ); } export function createListLogSummaryParser( diff --git a/simple-git/src/lib/responses/FileStatusSummary.ts b/simple-git/src/lib/responses/FileStatusSummary.ts index d4f91ed1..957aa197 100644 --- a/simple-git/src/lib/responses/FileStatusSummary.ts +++ b/simple-git/src/lib/responses/FileStatusSummary.ts @@ -5,7 +5,11 @@ export const fromPathRegex = /^(.+) -> (.+)$/; export class FileStatusSummary implements FileStatusResult { public readonly from: string | undefined; - constructor(public path: string, public index: string, public working_dir: string) { + constructor( + public path: string, + public index: string, + public working_dir: string + ) { if ('R' === index + working_dir) { const detail = fromPathRegex.exec(path) || [null, path, path]; this.from = detail[1] || ''; diff --git a/simple-git/src/lib/responses/TagList.ts b/simple-git/src/lib/responses/TagList.ts index b7f8c195..73a96177 100644 --- a/simple-git/src/lib/responses/TagList.ts +++ b/simple-git/src/lib/responses/TagList.ts @@ -1,7 +1,10 @@ import { TagResult } from '../../../typings'; export class TagList implements TagResult { - constructor(public readonly all: string[], public readonly latest: string | undefined) {} + constructor( + public readonly all: string[], + public readonly latest: string | undefined + ) {} } export const parseTagList = function (data: string, customSort = false) { diff --git a/simple-git/src/lib/utils/git-output-streams.ts b/simple-git/src/lib/utils/git-output-streams.ts index d85bd372..12bcff7e 100644 --- a/simple-git/src/lib/utils/git-output-streams.ts +++ b/simple-git/src/lib/utils/git-output-streams.ts @@ -1,7 +1,10 @@ import { TaskResponseFormat } from '../types'; export class GitOutputStreams { - constructor(public readonly stdOut: T, public readonly stdErr: T) {} + constructor( + public readonly stdOut: T, + public readonly stdErr: T + ) {} asStrings(): GitOutputStreams { return new GitOutputStreams(this.stdOut.toString('utf8'), this.stdErr.toString('utf8')); diff --git a/simple-git/test/unit/__fixtures__/responses/diff.ts b/simple-git/test/unit/__fixtures__/responses/diff.ts index 8372b746..3c5a2bef 100644 --- a/simple-git/test/unit/__fixtures__/responses/diff.ts +++ b/simple-git/test/unit/__fixtures__/responses/diff.ts @@ -18,9 +18,9 @@ function change(count: number, sign: '-' | '+') { function line(insertions: SmallNumber, deletions: SmallNumber, fileName: string) { return ` ${fileName} | ${insertions + deletions} ${''.padEnd(insertions, '+')}${''.padEnd( - deletions, - '-' - )}`; + deletions, + '-' + )}`; } export function diffSummarySingleFile( @@ -48,9 +48,9 @@ export function diffSummaryMultiFile( stdOut += ` ${files.length} file${files.length === 1 ? '' : 's'} changed ${change(add, '+')}${change( - del, - '-' - )} + del, + '-' + )} `; return createFixture(stdOut, ''); } diff --git a/simple-git/test/unit/promises.spec.ts b/simple-git/test/unit/promises.spec.ts index 681db131..a4c32c92 100644 --- a/simple-git/test/unit/promises.spec.ts +++ b/simple-git/test/unit/promises.spec.ts @@ -84,10 +84,13 @@ describe('promises', () => { const resolveMockCallCount = (c: jest.Mock) => c.mock.calls.length; function byName(resolver: (c: jest.Mock) => T) { - return callbacks.reduce((all, callback) => { - all[callback.getMockName()] = resolver(callback); - return all; - }, {} as { [key: string]: T }); + return callbacks.reduce( + (all, callback) => { + all[callback.getMockName()] = resolver(callback); + return all; + }, + {} as { [key: string]: T } + ); } return {