Sceptre / sceptre

Build better AWS infrastructure
https://docs.sceptre-project.org
Other
1.49k stars 313 forks source link

[Resolve #1498] Tweak diff output #1499

Closed alex-harvey-z3q closed 3 months ago

alex-harvey-z3q commented 3 months ago

In order to produce output that does not confuse syntax highlighters that recognise diff-formatted output, it is decided here to replace the "-" character (which would often cause a diff highlighter to colour the line as red) instead with "~" which would tend to be ignored by diff highlighters.

Showing GitHub's rendering of before- and after- output:

Before:

(Note that lines are highlighted in red that should not be.)

*****************************************************************************************                                                                                                             
--> Difference detected for stack flink-prod!                                                                                                                                    
-----------------------------------------------------------------------------------------                                                                                                             
Config difference for flink-prod:                                                                                                                                          

--- deployed                                                                                                                                                                                          
+++ generated                                                                                                                                                                                         
@@ -7,4 +7,4 @@                                                                                                                                                                                       
   Project: Datalake                                                                                                                                                                                  
   SourceControlPath: fsa/sceptre-environment/prod/datalake-prod                                                                                                              
   Team: DevOps                                                                                                                                                                                       
-  Version: 7.0.0                                                                                                                                                                                     
+  Version: 8.0.0                                                                                                                                                                                     
-----------------------------------------------------------------------------------------                                                                                                             
No template difference                                                                                                                                                                                
*****************************************************************************************                                                                                                             
--> Difference detected for stack flink-prod!                                                                                                                                       
-----------------------------------------------------------------------------------------
Config difference for flink-prod:

After:

*****************************************************************************************                                                                                                             
==> Difference detected for stack flink-prod!                                                                                                                                    
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Config difference for flink-prod:                                                                                                                                          

--- deployed                                                                                                                                                                                          
+++ generated                                                                                                                                                                                         
@@ -7,4 +7,4 @@                                                                                                                                                                                       
   Project: Datalake                                                                                                                                                                                  
   SourceControlPath: fsa/sceptre-environment/prod/datalake-prod                                                                                                              
   Team: DevOps                                                                                                                                                                                       
-  Version: 7.0.0                                                                                                                                                                                     
+  Version: 8.0.0                                                                                                                                                                                     
*****************************************************************************************                                                                                                             
No template difference                                                                                                                                                                                
*****************************************************************************************                                                                                                             
==> Difference detected for stack flink-prod!                                                                                                                                       
*****************************************************************************************                                                                                                             
Config difference for flink-prod:

PR Checklist

Approver/Reviewer Checklist

Other Information

Guide to writing a good commit