@@ -4,6 +4,7 @@ import pluralize from 'pluralize';
4
4
import { ZodError } from 'zod' ;
5
5
6
6
import { check } from '../linter' ;
7
+ import { SignaleRenderer } from '../utils/listr' ;
7
8
import { LoadLocalConfigurationTask } from './diff.command' ;
8
9
import { BaseCommand } from './helper' ;
9
10
@@ -28,7 +29,15 @@ export const LintTask = (): ListrTask<{ local: ADCSDK.Configuration }> => ({
28
29
29
30
// normal case
30
31
const resourceType = pluralize . singular ( error . path [ 0 ] as string ) ;
31
- const resourceName = ctx . local [ error . path [ 0 ] ] [ error . path [ 1 ] ] . name ;
32
+ const resource = ctx . local [ error . path [ 0 ] ] [ error . path [ 1 ] ] ;
33
+ const resourceName =
34
+ resourceType === 'global_rule' || resourceType === 'plugin_metadata'
35
+ ? error . path [ 1 ]
36
+ : resourceType === 'ssl'
37
+ ? resource . snis
38
+ : resourceType === 'consumer'
39
+ ? resource . username
40
+ : resource . name ;
32
41
err += `#${ idx + 1 } ${
33
42
error . message
34
43
} at ${ resourceType } : "${ resourceName } ", field: "${ (
@@ -59,10 +68,13 @@ export const LintCommand = new BaseCommand('lint')
59
68
. action ( async ( ) => {
60
69
const opts = LintCommand . optsWithGlobals ( ) ;
61
70
62
- const tasks = new Listr ( [
63
- LoadLocalConfigurationTask ( opts . file , { } ) ,
64
- LintTask ( ) ,
65
- ] ) ;
71
+ const tasks = new Listr (
72
+ [ LoadLocalConfigurationTask ( opts . file , { } ) , LintTask ( ) ] ,
73
+ {
74
+ renderer : SignaleRenderer ,
75
+ rendererOptions : { verbose : opts . verbose } ,
76
+ } ,
77
+ ) ;
66
78
67
79
try {
68
80
await tasks . run ( ) ;
0 commit comments