Skip to content

Commit

Permalink
style: apply automated linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
megalinter-bot committed Oct 11, 2023
1 parent 42510ba commit 5e7f583
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
12 changes: 7 additions & 5 deletions src/language/validation/other/statements/assignments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ import { assigneesOrEmpty } from '../../../helpers/nodeProperties.js';
export const CODE_ASSIGMENT_NOTHING_ASSIGNED = 'assignment/nothing-assigned';
export const CODE_ASSIGMENT_YIELD_FORBIDDEN_IN_PIPELINE = 'assignment/yield-forbidden-in-pipeline';

export const assignmentAssigneeMustGetValue = (services: SafeDsServices) => (node: SdsAssignment, accept: ValidationAcceptor): void => {
for (const assignee of assigneesOrEmpty(node)) {
export const assignmentAssigneeMustGetValue =
(services: SafeDsServices) =>
(node: SdsAssignment, accept: ValidationAcceptor): void => {
for (const assignee of assigneesOrEmpty(node)) {
if (!services.helpers.NodeMapper.assigneeToAssignedObjectOrUndefined(assignee)) {
accept('error', "No value is assigned to this assignee.", {
accept('error', 'No value is assigned to this assignee.', {
node: assignee,
code: CODE_ASSIGMENT_NOTHING_ASSIGNED,
});
}
}
}
}
};

export const yieldMustNotBeUsedInPipeline = (node: SdsYield, accept: ValidationAcceptor): void => {
const containingPipeline = getContainerOfType(node, isSdsPipeline);
Expand Down
7 changes: 2 additions & 5 deletions src/language/validation/safe-ds-validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
unionTypeShouldNotHaveASingularTypeArgument,
} from './style.js';
import { templateStringMustHaveExpressionBetweenTwoStringParts } from './other/expressions/templateStrings.js';
import {assignmentAssigneeMustGetValue, yieldMustNotBeUsedInPipeline} from './other/statements/assignments.js';
import { assignmentAssigneeMustGetValue, yieldMustNotBeUsedInPipeline } from './other/statements/assignments.js';
import { attributeMustHaveTypeHint, parameterMustHaveTypeHint, resultMustHaveTypeHint } from './types.js';
import { moduleDeclarationsMustMatchFileKind, moduleWithDeclarationsMustStatePackage } from './other/modules.js';
import { typeParameterConstraintLeftOperandMustBeOwnTypeParameter } from './other/declarations/typeParameterConstraints.js';
Expand Down Expand Up @@ -87,10 +87,7 @@ export const registerValidationChecks = function (services: SafeDsServices) {
assigneeAssignedResultShouldNotBeDeprecated(services),
assigneeAssignedResultShouldNotBeExperimental(services),
],
SdsAssignment: [
assignmentAssigneeMustGetValue(services),
assignmentShouldHaveMoreThanWildcardsAsAssignees
],
SdsAssignment: [assignmentAssigneeMustGetValue(services), assignmentShouldHaveMoreThanWildcardsAsAssignees],
SdsAnnotation: [
annotationMustContainUniqueNames,
annotationParameterListShouldNotBeEmpty,
Expand Down

0 comments on commit 5e7f583

Please sign in to comment.