@@ -883,6 +883,19 @@ fn tsconfig_pattern_severity_contract_keeps_noop_excludes_non_blocking() {
883883 . join ( "noop-node-modules-exclude/src/index.ts" ) ,
884884 "export const ok = true;\n " ,
885885 ) ;
886+ write (
887+ fixture. path ( ) . join ( "noop-generated-exclude/tsconfig.json" ) ,
888+ r#"
889+ {
890+ "include": ["src/**/*.ts"],
891+ "exclude": ["generated/**/*.ts"]
892+ }
893+ "# ,
894+ ) ;
895+ write (
896+ fixture. path ( ) . join ( "noop-generated-exclude/src/index.ts" ) ,
897+ "export const ok = true;\n " ,
898+ ) ;
886899
887900 let project = discover_project ( fixture. path ( ) ) . expect ( "project should discover" ) ;
888901 let outcome = run_tsconfig_check ( & project) . expect ( "check should run" ) ;
@@ -913,33 +926,48 @@ fn tsconfig_pattern_severity_contract_keeps_noop_excludes_non_blocking() {
913926 . join( "noop-node-modules-exclude/tsconfig.json" )
914927 . to_string_lossy( )
915928 ) ;
929+ assert ! (
930+ outcome
931+ . findings
932+ . iter( )
933+ . all( |finding| finding. id != noop_exclude_id) ,
934+ "default node_modules exclude should not report no-op audit noise"
935+ ) ;
936+
937+ let non_default_noop_exclude_id = format ! (
938+ "tsconfig-patterns:{}:exclude:generated/**/*.ts" ,
939+ fixture
940+ . path( )
941+ . join( "noop-generated-exclude/tsconfig.json" )
942+ . to_string_lossy( )
943+ ) ;
916944 assert_has_finding (
917945 & outcome. findings ,
918- & noop_exclude_id ,
946+ & non_default_noop_exclude_id ,
919947 Severity :: Info ,
920948 "Exclude pattern does not filter any included files" ,
921949 & format ! (
922- "exclude pattern \" node_modules \" removed 0 files from 1 included file(s) under base dir {}." ,
950+ "exclude pattern \" generated/**/*.ts \" removed 0 files from 1 included file(s) under base dir {}." ,
923951 fixture
924952 . path( )
925- . join( "noop-node-modules -exclude" )
953+ . join( "noop-generated -exclude" )
926954 . to_string_lossy( )
927955 ) ,
928956 "Remove or tighten exclude entries that do not change the effective TypeScript input set." ,
929957 Some (
930958 fixture
931959 . path ( )
932- . join ( "noop-node-modules -exclude/tsconfig.json" ) ,
960+ . join ( "noop-generated -exclude/tsconfig.json" ) ,
933961 ) ,
934962 ) ;
935963
936- let noop_exclude_finding = outcome
964+ let non_default_noop_exclude_finding = outcome
937965 . findings
938966 . iter ( )
939- . find ( |finding| finding. id == noop_exclude_id )
940- . expect ( "no-op node_modules exclude finding should exist" ) ;
967+ . find ( |finding| finding. id == non_default_noop_exclude_id )
968+ . expect ( "non-default no-op exclude finding should exist" ) ;
941969 let summary = summarize_findings (
942- std:: slice:: from_ref ( noop_exclude_finding ) ,
970+ std:: slice:: from_ref ( non_default_noop_exclude_finding ) ,
943971 & outcome. fixes ,
944972 & StructureReport {
945973 is_monorepo : false ,
0 commit comments