From 79a35261aa4b9643c8ebc46d92e8c8c6f2dc1592 Mon Sep 17 00:00:00 2001 From: megalinter-bot <129584137+megalinter-bot@users.noreply.github.com> Date: Mon, 9 Oct 2023 09:44:51 +0000 Subject: [PATCH] style: apply automated linter fixes --- src/language/validation/safe-ds-validator.ts | 4 +--- tests/helpers/diagnostics.ts | 10 ++++++++-- tests/helpers/testChecks.ts | 12 ++++++------ tests/helpers/testDescription.ts | 2 +- tests/language/validation/creator.ts | 14 ++++++++++---- 5 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/language/validation/safe-ds-validator.ts b/src/language/validation/safe-ds-validator.ts index 43629e25b..ab77827e5 100644 --- a/src/language/validation/safe-ds-validator.ts +++ b/src/language/validation/safe-ds-validator.ts @@ -116,9 +116,7 @@ export const registerValidationChecks = function (services: SafeDsServices) { namedTypeTypeArgumentListShouldBeNeeded, ], SdsParameter: [parameterMustHaveTypeHint], - SdsParameterList: [ - parameterListMustNotHaveRequiredParametersAfterOptionalParameters, - ], + SdsParameterList: [parameterListMustNotHaveRequiredParametersAfterOptionalParameters], SdsPipeline: [pipelineMustContainUniqueNames], SdsPlaceholder: [placeholderShouldBeUsed(services)], SdsReference: [ diff --git a/tests/helpers/diagnostics.ts b/tests/helpers/diagnostics.ts index c733726a0..07bc5d3ce 100644 --- a/tests/helpers/diagnostics.ts +++ b/tests/helpers/diagnostics.ts @@ -61,7 +61,10 @@ const getDiagnostics = async (services: LangiumServices, code: string): Promise< * The code contains syntax errors. */ export class SyntaxErrorsInCodeError extends TestDescriptionError { - constructor(readonly syntaxErrors: Diagnostic[], uri: URI) { + constructor( + readonly syntaxErrors: Diagnostic[], + uri: URI, + ) { const syntaxErrorsAsString = syntaxErrors.map((e) => ` - ${e.message}`).join(`\n`); super(`Code has syntax errors:\n${syntaxErrorsAsString}`, uri); @@ -72,7 +75,10 @@ export class SyntaxErrorsInCodeError extends TestDescriptionError { * The code contains syntax errors. */ export class ErrorsInCodeError extends TestDescriptionError { - constructor(readonly errors: Diagnostic[], uri: URI) { + constructor( + readonly errors: Diagnostic[], + uri: URI, + ) { const syntaxErrorsAsString = errors.map((e) => ` - ${e.message}`).join(`\n`); super(`Code has errors:\n${syntaxErrorsAsString}`, uri); diff --git a/tests/helpers/testChecks.ts b/tests/helpers/testChecks.ts index 56711b5ec..d9bbc2ae1 100644 --- a/tests/helpers/testChecks.ts +++ b/tests/helpers/testChecks.ts @@ -1,9 +1,9 @@ -import {Location, Range} from 'vscode-languageserver'; -import {findTestComments} from './testComments.js'; -import {findTestRanges, FindTestRangesError} from './testRanges.js'; -import {Result} from 'true-myth'; -import {URI} from 'langium'; -import {TestDescriptionError} from './testDescription.js'; +import { Location, Range } from 'vscode-languageserver'; +import { findTestComments } from './testComments.js'; +import { findTestRanges, FindTestRangesError } from './testRanges.js'; +import { Result } from 'true-myth'; +import { URI } from 'langium'; +import { TestDescriptionError } from './testDescription.js'; /** * Finds all test checks, i.e. test comments and their corresponding test ranges. diff --git a/tests/helpers/testDescription.ts b/tests/helpers/testDescription.ts index aac6a5558..2d5a5b4af 100644 --- a/tests/helpers/testDescription.ts +++ b/tests/helpers/testDescription.ts @@ -1,4 +1,4 @@ -import {URI} from "langium"; +import { URI } from 'langium'; /** * A description of a test. This interface should be extended to describe tests of specific components. diff --git a/tests/language/validation/creator.ts b/tests/language/validation/creator.ts index 99fbf6812..545bb58b1 100644 --- a/tests/language/validation/creator.ts +++ b/tests/language/validation/creator.ts @@ -1,11 +1,11 @@ import { listSafeDsFilesGroupedByParentDirectory, uriToShortenedResourceName } from '../../helpers/testResources.js'; import fs from 'fs'; import { findTestChecks } from '../../helpers/testChecks.js'; -import {getSyntaxErrors, SyntaxErrorsInCodeError} from '../../helpers/diagnostics.js'; +import { getSyntaxErrors, SyntaxErrorsInCodeError } from '../../helpers/diagnostics.js'; import { EmptyFileSystem, URI } from 'langium'; import { createSafeDsServices } from '../../../src/language/safe-ds-module.js'; import { Range } from 'vscode-languageserver-types'; -import {TestDescription, TestDescriptionError} from '../../helpers/testDescription.js'; +import { TestDescription, TestDescriptionError } from '../../helpers/testDescription.js'; const services = createSafeDsServices(EmptyFileSystem).SafeDs; const rootResourceName = 'validation'; @@ -161,7 +161,10 @@ export type Severity = (typeof validSeverities)[number]; * A test comment did not match the expected format. */ class InvalidCommentError extends TestDescriptionError { - constructor(readonly comment: string, uri: URI) { + constructor( + readonly comment: string, + uri: URI, + ) { super(`Invalid test comment (refer to the documentation for guidance): ${comment}`, uri); } } @@ -170,7 +173,10 @@ class InvalidCommentError extends TestDescriptionError { * A test comment did not specify a valid severity. */ class InvalidSeverityError extends TestDescriptionError { - constructor(readonly type: string, uri: URI) { + constructor( + readonly type: string, + uri: URI, + ) { super(`Invalid severity (valid values are ${validSeverities.join(', ')}): ${type}`, uri); } }