@@ -1193,47 +1193,47 @@ fn format_kubelint_result(
11931193 let mut lines = Vec :: new ( ) ;
11941194
11951195 // Check for parse errors first
1196- if let Some ( errors) = parse_errors {
1197- if !errors. is_empty ( ) {
1198- lines. push ( format ! (
1199- "{}☸ {} parse error{} (files could not be fully analyzed){}" ,
1200- ansi:: HIGH ,
1201- errors. len( ) ,
1202- if errors. len( ) == 1 { "" } else { "s" } ,
1203- ansi:: RESET
1204- ) ) ;
1205- for ( i, err) in errors. iter ( ) . take ( 3 ) . enumerate ( ) {
1206- if let Some ( err_str) = err. as_str ( ) {
1207- let truncated = if err_str. len ( ) > 70 {
1208- format ! ( "{}..." , & err_str[ ..67 ] )
1209- } else {
1210- err_str. to_string ( )
1211- } ;
1212- lines. push ( format ! (
1213- "{} {} {}{}" ,
1214- ansi:: HIGH ,
1215- if i == errors. len( ) . min( 3 ) - 1 {
1216- "└"
1217- } else {
1218- "│"
1219- } ,
1220- truncated,
1221- ansi:: RESET
1222- ) ) ;
1223- }
1224- }
1225- if errors. len ( ) > 3 {
1196+ if let Some ( errors) = parse_errors
1197+ && !errors. is_empty ( )
1198+ {
1199+ lines. push ( format ! (
1200+ "{}☸ {} parse error{} (files could not be fully analyzed){}" ,
1201+ ansi:: HIGH ,
1202+ errors. len( ) ,
1203+ if errors. len( ) == 1 { "" } else { "s" } ,
1204+ ansi:: RESET
1205+ ) ) ;
1206+ for ( i, err) in errors. iter ( ) . take ( 3 ) . enumerate ( ) {
1207+ if let Some ( err_str) = err. as_str ( ) {
1208+ let truncated = if err_str. len ( ) > 70 {
1209+ format ! ( "{}..." , & err_str[ ..67 ] )
1210+ } else {
1211+ err_str. to_string ( )
1212+ } ;
12261213 lines. push ( format ! (
1227- "{} +{} more errors{}" ,
1228- ansi:: GRAY ,
1229- errors. len( ) - 3 ,
1214+ "{} {} {}{}" ,
1215+ ansi:: HIGH ,
1216+ if i == errors. len( ) . min( 3 ) - 1 {
1217+ "└"
1218+ } else {
1219+ "│"
1220+ } ,
1221+ truncated,
12301222 ansi:: RESET
12311223 ) ) ;
12321224 }
1233- // If we only have parse errors and no lint issues, return early
1234- if total == 0 {
1235- return ( false , lines) ;
1236- }
1225+ }
1226+ if errors. len ( ) > 3 {
1227+ lines. push ( format ! (
1228+ "{} +{} more errors{}" ,
1229+ ansi:: GRAY ,
1230+ errors. len( ) - 3 ,
1231+ ansi:: RESET
1232+ ) ) ;
1233+ }
1234+ // If we only have parse errors and no lint issues, return early
1235+ if total == 0 {
1236+ return ( false , lines) ;
12371237 }
12381238 }
12391239
@@ -1326,33 +1326,32 @@ fn format_kubelint_result(
13261326 }
13271327
13281328 // Then high priority
1329- if shown < MAX_PREVIEW {
1330- if let Some ( high_issues) = action_plan
1329+ if shown < MAX_PREVIEW
1330+ && let Some ( high_issues) = action_plan
13311331 . and_then ( |a| a. get ( "high" ) )
13321332 . and_then ( |h| h. as_array ( ) )
1333- {
1334- for issue in high_issues. iter ( ) . take ( MAX_PREVIEW - shown) {
1335- lines. push ( format_kubelint_issue ( issue, "🟠" , ansi:: HIGH ) ) ;
1336- shown += 1 ;
1337- }
1333+ {
1334+ for issue in high_issues. iter ( ) . take ( MAX_PREVIEW - shown) {
1335+ lines. push ( format_kubelint_issue ( issue, "🟠" , ansi:: HIGH ) ) ;
1336+ shown += 1 ;
13381337 }
13391338 }
13401339
13411340 // Show quick fix hint
1342- if let Some ( quick_fixes) = v. get ( "quick_fixes" ) . and_then ( |q| q. as_array ( ) ) {
1343- if let Some ( first_fix) = quick_fixes. first ( ) . and_then ( |f| f. as_str ( ) ) {
1344- let truncated = if first_fix . len ( ) > 70 {
1345- format ! ( "{}..." , & first_fix [ .. 67 ] )
1346- } else {
1347- first_fix . to_string ( )
1348- } ;
1349- lines . push ( format ! (
1350- "{} → Fix: {}{}" ,
1351- ansi :: INFO_BLUE ,
1352- truncated ,
1353- ansi :: RESET
1354- ) ) ;
1355- }
1341+ if let Some ( quick_fixes) = v. get ( "quick_fixes" ) . and_then ( |q| q. as_array ( ) )
1342+ && let Some ( first_fix) = quick_fixes. first ( ) . and_then ( |f| f. as_str ( ) )
1343+ {
1344+ let truncated = if first_fix . len ( ) > 70 {
1345+ format ! ( "{}..." , & first_fix [ .. 67 ] )
1346+ } else {
1347+ first_fix . to_string ( )
1348+ } ;
1349+ lines . push ( format ! (
1350+ "{} → Fix: {}{}" ,
1351+ ansi :: INFO_BLUE ,
1352+ truncated ,
1353+ ansi :: RESET
1354+ ) ) ;
13561355 }
13571356
13581357 // Note about remaining issues
@@ -1429,47 +1428,47 @@ fn format_helmlint_result(
14291428 let mut lines = Vec :: new ( ) ;
14301429
14311430 // Check for parse errors first
1432- if let Some ( errors) = parse_errors {
1433- if !errors. is_empty ( ) {
1434- lines. push ( format ! (
1435- "{}⎈ {} parse error{} (chart could not be fully analyzed){}" ,
1436- ansi:: HIGH ,
1437- errors. len( ) ,
1438- if errors. len( ) == 1 { "" } else { "s" } ,
1439- ansi:: RESET
1440- ) ) ;
1441- for ( i, err) in errors. iter ( ) . take ( 3 ) . enumerate ( ) {
1442- if let Some ( err_str) = err. as_str ( ) {
1443- let truncated = if err_str. len ( ) > 70 {
1444- format ! ( "{}..." , & err_str[ ..67 ] )
1445- } else {
1446- err_str. to_string ( )
1447- } ;
1448- lines. push ( format ! (
1449- "{} {} {}{}" ,
1450- ansi:: HIGH ,
1451- if i == errors. len( ) . min( 3 ) - 1 {
1452- "└"
1453- } else {
1454- "│"
1455- } ,
1456- truncated,
1457- ansi:: RESET
1458- ) ) ;
1459- }
1460- }
1461- if errors. len ( ) > 3 {
1431+ if let Some ( errors) = parse_errors
1432+ && !errors. is_empty ( )
1433+ {
1434+ lines. push ( format ! (
1435+ "{}⎈ {} parse error{} (chart could not be fully analyzed){}" ,
1436+ ansi:: HIGH ,
1437+ errors. len( ) ,
1438+ if errors. len( ) == 1 { "" } else { "s" } ,
1439+ ansi:: RESET
1440+ ) ) ;
1441+ for ( i, err) in errors. iter ( ) . take ( 3 ) . enumerate ( ) {
1442+ if let Some ( err_str) = err. as_str ( ) {
1443+ let truncated = if err_str. len ( ) > 70 {
1444+ format ! ( "{}..." , & err_str[ ..67 ] )
1445+ } else {
1446+ err_str. to_string ( )
1447+ } ;
14621448 lines. push ( format ! (
1463- "{} +{} more errors{}" ,
1464- ansi:: GRAY ,
1465- errors. len( ) - 3 ,
1449+ "{} {} {}{}" ,
1450+ ansi:: HIGH ,
1451+ if i == errors. len( ) . min( 3 ) - 1 {
1452+ "└"
1453+ } else {
1454+ "│"
1455+ } ,
1456+ truncated,
14661457 ansi:: RESET
14671458 ) ) ;
14681459 }
1469- // If we only have parse errors and no lint issues, return early
1470- if total == 0 {
1471- return ( false , lines) ;
1472- }
1460+ }
1461+ if errors. len ( ) > 3 {
1462+ lines. push ( format ! (
1463+ "{} +{} more errors{}" ,
1464+ ansi:: GRAY ,
1465+ errors. len( ) - 3 ,
1466+ ansi:: RESET
1467+ ) ) ;
1468+ }
1469+ // If we only have parse errors and no lint issues, return early
1470+ if total == 0 {
1471+ return ( false , lines) ;
14731472 }
14741473 }
14751474
@@ -1562,33 +1561,32 @@ fn format_helmlint_result(
15621561 }
15631562
15641563 // Then high priority
1565- if shown < MAX_PREVIEW {
1566- if let Some ( high_issues) = action_plan
1564+ if shown < MAX_PREVIEW
1565+ && let Some ( high_issues) = action_plan
15671566 . and_then ( |a| a. get ( "high" ) )
15681567 . and_then ( |h| h. as_array ( ) )
1569- {
1570- for issue in high_issues. iter ( ) . take ( MAX_PREVIEW - shown) {
1571- lines. push ( format_helmlint_issue ( issue, "🟠" , ansi:: HIGH ) ) ;
1572- shown += 1 ;
1573- }
1568+ {
1569+ for issue in high_issues. iter ( ) . take ( MAX_PREVIEW - shown) {
1570+ lines. push ( format_helmlint_issue ( issue, "🟠" , ansi:: HIGH ) ) ;
1571+ shown += 1 ;
15741572 }
15751573 }
15761574
15771575 // Show quick fix hint
1578- if let Some ( quick_fixes) = v. get ( "quick_fixes" ) . and_then ( |q| q. as_array ( ) ) {
1579- if let Some ( first_fix) = quick_fixes. first ( ) . and_then ( |f| f. as_str ( ) ) {
1580- let truncated = if first_fix . len ( ) > 70 {
1581- format ! ( "{}..." , & first_fix [ .. 67 ] )
1582- } else {
1583- first_fix . to_string ( )
1584- } ;
1585- lines . push ( format ! (
1586- "{} → Fix: {}{}" ,
1587- ansi :: INFO_BLUE ,
1588- truncated ,
1589- ansi :: RESET
1590- ) ) ;
1591- }
1576+ if let Some ( quick_fixes) = v. get ( "quick_fixes" ) . and_then ( |q| q. as_array ( ) )
1577+ && let Some ( first_fix) = quick_fixes. first ( ) . and_then ( |f| f. as_str ( ) )
1578+ {
1579+ let truncated = if first_fix . len ( ) > 70 {
1580+ format ! ( "{}..." , & first_fix [ .. 67 ] )
1581+ } else {
1582+ first_fix . to_string ( )
1583+ } ;
1584+ lines . push ( format ! (
1585+ "{} → Fix: {}{}" ,
1586+ ansi :: INFO_BLUE ,
1587+ truncated ,
1588+ ansi :: RESET
1589+ ) ) ;
15921590 }
15931591
15941592 // Note about remaining issues
0 commit comments