Skip to content

Commit 9590185

Browse files
author
Szymon.Poltorak
committed
feat(): fix code style and tool description
1 parent 06560e9 commit 9590185

File tree

4 files changed

+23
-22
lines changed

4 files changed

+23
-22
lines changed

packages/angular-mcp-server/src/lib/tools/ds/ds.tools.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ import { ToolSchemaOptions } from '@push-based/models';
66
import { dsComponentCoveragePlugin } from '@push-based/ds-component-coverage';
77
import { baseToolsSchema } from '../schema';
88
import { join } from 'node:path';
9-
import { reportViolationsTools, reportAllViolationsTools } from './report-violations/index.js';
9+
import {
10+
reportViolationsTools,
11+
reportAllViolationsTools,
12+
} from './report-violations/index.js';
1013

1114
export const componentCoverageToolsSchema: ToolSchemaOptions = {
1215
name: 'ds_component-coverage',

packages/angular-mcp-server/src/lib/tools/ds/report-violations/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export { reportViolationsTools } from './report-violations.tool';
2-
export { reportAllViolationsTools } from './report-violations-all.tool';
2+
export { reportAllViolationsTools } from './report-all-violations.tool';
33

44
export type {
55
ReportViolationsOptions,
Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import { createHandler, BaseHandlerOptions } from '../shared/utils/handler-helpers.js';
21
import {
3-
createProjectAnalysisSchema,
2+
BaseHandlerOptions,
3+
createHandler,
4+
} from '../shared/utils/handler-helpers.js';
5+
import {
46
COMMON_ANNOTATIONS,
7+
createProjectAnalysisSchema,
58
} from '../shared/models/schema-helpers.js';
6-
import {
7-
analyzeProjectCoverage,
8-
} from '../shared/violation-analysis/coverage-analyzer.js';
9+
import { analyzeProjectCoverage } from '../shared/violation-analysis/coverage-analyzer.js';
910
import { formatViolations } from '../shared/violation-analysis/formatters.js';
1011
import { loadAndValidateDsComponentsFile } from '../../../validation/ds-components-file-loader.validation.js';
1112

@@ -17,7 +18,7 @@ interface ReportAllViolationsOptions extends BaseHandlerOptions {
1718
export const reportAllViolationsSchema = {
1819
name: 'report-all-violations',
1920
description:
20-
'Report all deprecated DS CSS usage for every component defined in the config file within a directory.',
21+
'Scan a directory for deprecated design system CSS classes defined in the config at `deprecatedCssClassesPath`, and output a usage report',
2122
inputSchema: createProjectAnalysisSchema({
2223
groupBy: {
2324
type: 'string',
@@ -32,9 +33,6 @@ export const reportAllViolationsSchema = {
3233
},
3334
};
3435

35-
36-
// Reuse centralized loader+validator for DS components config
37-
3836
export const reportAllViolationsHandler = createHandler<
3937
ReportAllViolationsOptions,
4038
string[]
@@ -57,20 +55,17 @@ export const reportAllViolationsHandler = createHandler<
5755
const raw = coverageResult.rawData?.rawPluginResult;
5856
if (!raw) return [];
5957

60-
// Reuse the existing minimal formatter so output format matches report-violations
61-
// and respect groupBy option.
6258
const formattedContent = formatViolations(raw, params.directory, {
6359
groupBy: groupBy === 'file' ? 'file' : 'folder',
6460
});
6561

66-
// Extract text items to string[]
67-
const lines = formattedContent.map((item: { type?: string; text?: string } | string) => {
68-
if (typeof item === 'string') return item;
69-
if (item && typeof item.text === 'string') return item.text;
70-
return String(item);
71-
});
72-
73-
return lines;
62+
return formattedContent.map(
63+
(item: { type?: string; text?: string } | string) => {
64+
if (typeof item === 'string') return item;
65+
if (item && typeof item.text === 'string') return item.text;
66+
return String(item);
67+
},
68+
);
7469
},
7570
(result) => result,
7671
);

packages/angular-mcp-server/src/lib/tools/ds/tools.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { ToolsConfig } from '@push-based/models';
2-
import { reportViolationsTools, reportAllViolationsTools } from './report-violations';
2+
import {
3+
reportViolationsTools,
4+
reportAllViolationsTools,
5+
} from './report-violations';
36
import { getProjectDependenciesTools } from './project/get-project-dependencies.tool';
47
import { reportDeprecatedCssTools } from './project/report-deprecated-css.tool';
58
import { buildComponentUsageGraphTools } from './component-usage-graph';

0 commit comments

Comments
 (0)