@@ -1194,47 +1194,48 @@ fn format_kubelint_result(
11941194
11951195 // Check for parse errors first
11961196 if let Some ( errors) = parse_errors
1197- && !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 {
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- }
12371225 }
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) ;
1237+ }
1238+ }
12381239
12391240 if total == 0 && parse_errors. map ( |e| e. is_empty ( ) ) . unwrap_or ( true ) {
12401241 lines. push ( format ! (
@@ -1329,28 +1330,29 @@ fn format_kubelint_result(
13291330 && let Some ( high_issues) = action_plan
13301331 . and_then ( |a| a. get ( "high" ) )
13311332 . and_then ( |h| h. as_array ( ) )
1332- {
1333- for issue in high_issues. iter ( ) . take ( MAX_PREVIEW - shown) {
1334- lines. push ( format_kubelint_issue ( issue, "🟠" , ansi:: HIGH ) ) ;
1335- shown += 1 ;
1336- }
1333+ {
1334+ for issue in high_issues. iter ( ) . take ( MAX_PREVIEW - shown) {
1335+ lines. push ( format_kubelint_issue ( issue, "🟠" , ansi:: HIGH ) ) ;
1336+ shown += 1 ;
13371337 }
1338+ }
13381339
13391340 // Show quick fix hint
13401341 if let Some ( quick_fixes) = v. get ( "quick_fixes" ) . and_then ( |q| q. as_array ( ) )
1341- && let Some ( first_fix) = quick_fixes. first ( ) . and_then ( |f| f. as_str ( ) ) {
1342- let truncated = if first_fix. len ( ) > 70 {
1343- format ! ( "{}..." , & first_fix[ ..67 ] )
1344- } else {
1345- first_fix. to_string ( )
1346- } ;
1347- lines. push ( format ! (
1348- "{} → Fix: {}{}" ,
1349- ansi:: INFO_BLUE ,
1350- truncated,
1351- ansi:: RESET
1352- ) ) ;
1353- }
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+ ) ) ;
1355+ }
13541356
13551357 // Note about remaining issues
13561358 let remaining = total as usize - shown;
@@ -1427,47 +1429,48 @@ fn format_helmlint_result(
14271429
14281430 // Check for parse errors first
14291431 if let Some ( errors) = parse_errors
1430- && !errors. is_empty ( ) {
1431- lines. push ( format ! (
1432- "{}⎈ {} parse error{} (chart could not be fully analyzed){}" ,
1433- ansi:: HIGH ,
1434- errors. len( ) ,
1435- if errors. len( ) == 1 { "" } else { "s" } ,
1436- ansi:: RESET
1437- ) ) ;
1438- for ( i, err) in errors. iter ( ) . take ( 3 ) . enumerate ( ) {
1439- if let Some ( err_str) = err. as_str ( ) {
1440- let truncated = if err_str. len ( ) > 70 {
1441- format ! ( "{}..." , & err_str[ ..67 ] )
1442- } else {
1443- err_str. to_string ( )
1444- } ;
1445- lines. push ( format ! (
1446- "{} {} {}{}" ,
1447- ansi:: HIGH ,
1448- if i == errors. len( ) . min( 3 ) - 1 {
1449- "└"
1450- } else {
1451- "│"
1452- } ,
1453- truncated,
1454- ansi:: RESET
1455- ) ) ;
1456- }
1457- }
1458- if errors. len ( ) > 3 {
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+ } ;
14591448 lines. push ( format ! (
1460- "{} +{} more errors{}" ,
1461- ansi:: GRAY ,
1462- errors. len( ) - 3 ,
1449+ "{} {} {}{}" ,
1450+ ansi:: HIGH ,
1451+ if i == errors. len( ) . min( 3 ) - 1 {
1452+ "└"
1453+ } else {
1454+ "│"
1455+ } ,
1456+ truncated,
14631457 ansi:: RESET
14641458 ) ) ;
14651459 }
1466- // If we only have parse errors and no lint issues, return early
1467- if total == 0 {
1468- return ( false , lines) ;
1469- }
14701460 }
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) ;
1472+ }
1473+ }
14711474
14721475 if total == 0 && parse_errors. map ( |e| e. is_empty ( ) ) . unwrap_or ( true ) {
14731476 lines. push ( format ! (
@@ -1562,28 +1565,29 @@ fn format_helmlint_result(
15621565 && let Some ( high_issues) = action_plan
15631566 . and_then ( |a| a. get ( "high" ) )
15641567 . and_then ( |h| h. as_array ( ) )
1565- {
1566- for issue in high_issues. iter ( ) . take ( MAX_PREVIEW - shown) {
1567- lines. push ( format_helmlint_issue ( issue, "🟠" , ansi:: HIGH ) ) ;
1568- shown += 1 ;
1569- }
1568+ {
1569+ for issue in high_issues. iter ( ) . take ( MAX_PREVIEW - shown) {
1570+ lines. push ( format_helmlint_issue ( issue, "🟠" , ansi:: HIGH ) ) ;
1571+ shown += 1 ;
15701572 }
1573+ }
15711574
15721575 // Show quick fix hint
15731576 if let Some ( quick_fixes) = v. get ( "quick_fixes" ) . and_then ( |q| q. as_array ( ) )
1574- && let Some ( first_fix) = quick_fixes. first ( ) . and_then ( |f| f. as_str ( ) ) {
1575- let truncated = if first_fix. len ( ) > 70 {
1576- format ! ( "{}..." , & first_fix[ ..67 ] )
1577- } else {
1578- first_fix. to_string ( )
1579- } ;
1580- lines. push ( format ! (
1581- "{} → Fix: {}{}" ,
1582- ansi:: INFO_BLUE ,
1583- truncated,
1584- ansi:: RESET
1585- ) ) ;
1586- }
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+ ) ) ;
1590+ }
15871591
15881592 // Note about remaining issues
15891593 let remaining = total as usize - shown;
0 commit comments