@@ -40,23 +40,22 @@ public override string ToString()
4040 var outputBuilder = new StringBuilder ( base . ToString ( ) ) ;
4141 outputBuilder . Append ( '\n ' ) ;
4242
43- if ( Status == CheckStatus . Green )
43+ // ReSharper disable once SwitchStatementMissingSomeEnumCasesNoDefault
44+ switch ( Status )
4445 {
45- outputBuilder . Append ( $ "Ran Trufflehog with command \" { _lastRunCommand } \" and no secrets where found.") ;
46- return outputBuilder . ToString ( ) ;
47- }
48-
49- if ( Status == CheckStatus . Yellow )
50- {
51- outputBuilder . Append ( _additionalInfo ) ;
52- return outputBuilder . ToString ( ) ;
46+ case CheckStatus . Green :
47+ outputBuilder . Append ( $ "Ran Trufflehog with command \" { _lastRunCommand } \" and no secrets where found.") ;
48+ return outputBuilder . ToString ( ) ;
49+ case CheckStatus . Yellow :
50+ outputBuilder . Append ( _additionalInfo ) ;
51+ return outputBuilder . ToString ( ) ;
5352 }
5453
5554 outputBuilder . Append ( "\n Secrets found:\n " ) ;
5655
5756 foreach ( var secret in _foundSecretsJson )
5857 {
59- var formatted = TrufflehogJsonToString ( secret ) ;
58+ string formatted = TrufflehogJsonToString ( secret ) ;
6059
6160 if ( formatted == null )
6261 {
@@ -67,12 +66,12 @@ public override string ToString()
6766 }
6867
6968 // Number of secrets found
70- outputBuilder . Append ( $ "Total number of secrets found: { _foundSecretsJson . Count } \n ") ;
69+ outputBuilder . Append ( $ "Total number of secrets found: { _foundSecretsJson . Count } ") ;
7170
72- if ( _fileHasBeenIgnored )
73- {
74- outputBuilder . Append ( _additionalInfo ) ;
75- }
71+ if ( ! _fileHasBeenIgnored ) return outputBuilder . ToString ( ) ;
72+
73+ outputBuilder . Append ( Environment . NewLine ) ;
74+ outputBuilder . Append ( _additionalInfo ) ;
7675
7776 return outputBuilder . ToString ( ) ;
7877 }
0 commit comments