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

refactor(indent): use filter block to indent included files #32

Merged

Conversation

baby-gnu
Copy link
Contributor

Instead of manually managing an {{ indentation }} prefix for all
lines, use a {%- filter indent(width=2) %} block around the
includes.

This results in the following diff from previous method:

--- 
+++ 
@@ -69,11 +69,12 @@
   default-lease-time 600;
   max-lease-time 7200;
   option routers 10.5.5.1;
-# Hosts can be specified for subnets, taking subnets defaults
-host jake {
-  hardware ethernet 08:00:a7:26:c0:a9;
-  fixed-address 10.5.5.27;
-}
+  
+  # Hosts can be specified for subnets, taking subnets defaults
+  host jake {
+    hardware ethernet 08:00:a7:26:c0:a9;
+    fixed-address 10.5.5.27;
+  }
 }
 
 
@@ -108,9 +109,11 @@
 }
 
 shared-network 224-29 {
+  
   subnet 10.17.224.0 netmask 255.255.255.0 {
     option routers rtr-224.example.org;
   }
+  
   subnet 10.0.29.0 netmask 255.255.255.0 {
     option routers rtr-29.example.org;
   }

Instead of manually managing an `{{ indentation }}` prefix for all
lines, use a `{%- filter indent(width=2) %}` block around the
includes.
@baby-gnu baby-gnu requested a review from myii July 31, 2019 14:26
@baby-gnu
Copy link
Contributor Author

I think this could interest @aaannz since you provided #29.

Regards.

@aaannz
Copy link
Contributor

aaannz commented Jul 31, 2019

👍
Thanks for keeping me in the loop

@myii
Copy link
Member

myii commented Jul 31, 2019

@aaannz Would you like to review these changes and suggest any comments inline (from the Files changed page)?

Copy link
Contributor

@aaannz aaannz left a comment

Choose a reason for hiding this comment

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

LGTM

@myii
Copy link
Member

myii commented Jul 31, 2019

Thanks @aaannz. I'm just going to get #31 merged first before coming back to this one.

@myii myii merged commit f9230a8 into saltstack-formulas:master Jul 31, 2019
@myii
Copy link
Member

myii commented Jul 31, 2019

Merged, thanks @baby-gnu and @aaannz for the review.

@saltstack-formulas-travis

🎉 This PR is included in version 0.7.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@baby-gnu baby-gnu deleted the feature/better-indentation-method branch August 1, 2019 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants