Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Resolve #1498] Tweak diff output #1499

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

alex-harvey-z3q
Copy link
Contributor

@alex-harvey-z3q alex-harvey-z3q commented Aug 20, 2024

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

  • Wrote a good commit message & description [see guide below].
  • Commit message starts with [Resolve #issue-number].
  • Added/Updated unit tests.
  • Added/Updated integration tests (if applicable).
  • All unit tests (poetry run tox) are passing.
  • Used the same coding conventions as the rest of the project.
  • The new code passes pre-commit validations (poetry run pre-commit run --all-files).
  • The PR relates to only one subject with a clear title.
    and description in grammatically correct, complete sentences.

Approver/Reviewer Checklist

  • Before merge squash related commits.

Other Information

Guide to writing a good commit

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.
Copy link
Contributor

@jfalkenstein jfalkenstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful.

@alex-harvey-z3q alex-harvey-z3q merged commit d8b8b5b into Sceptre:master Aug 20, 2024
11 checks passed
@alex-harvey-z3q alex-harvey-z3q deleted the ah/1498-tweak-diffs branch August 20, 2024 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants