@@ -14,7 +14,7 @@ import { cwd, env, exit } from "node:process";
1414import { parseArgs } from "node:util" ;
1515
1616import { error , notice , summary , warning } from "@actions/core" ;
17- import { Document , Spectral } from "@stoplight/spectral-core" ;
17+ import { Document , Ruleset , Spectral } from "@stoplight/spectral-core" ;
1818import Parsers from "@stoplight/spectral-parsers" ;
1919
2020import { defaultRuleset } from "./ruleset" ;
@@ -39,7 +39,7 @@ const { values: { only = [], except = [], ci, fail }, positionals } = parseArgs(
3939 } ,
4040 fail : {
4141 type : "string" ,
42- default : "2 " ,
42+ default : "0 " ,
4343 short : "f" ,
4444 }
4545 }
@@ -66,7 +66,7 @@ interface ExecuteOptions {
6666
6767async function execute ( filename : string , { only, except, failSeverity, ci } : ExecuteOptions ) {
6868 const spectral = new Spectral ( ) ;
69- spectral . setRuleset ( defaultRuleset ) ;
69+ spectral . setRuleset ( new Ruleset ( defaultRuleset , { source : filename } ) ) ;
7070
7171 if ( except . length > 0 )
7272 for ( const rule of except )
@@ -100,7 +100,6 @@ async function execute(filename: string, { only, except, failSeverity, ci }: Exe
100100 summary . addRaw ( `${ diagnostics . length } issue(s).` , true ) ;
101101 summary . addBreak ( ) ;
102102
103- // group by file.
104103 const diagnosticsBySource = diagnostics . reduce ( ( acc , diag ) => {
105104 const file = diag . source || "<unknown>" ;
106105 if ( ! acc [ file ] ) acc [ file ] = [ ] ;
0 commit comments