saltstack-formulas / dhcpd-formula

http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
8 stars 56 forks source link

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

Closed baby-gnu closed 5 years ago

baby-gnu commented 5 years ago

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;
   }

#

baby-gnu commented 5 years ago

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

Regards.

aaannz commented 5 years ago

:+1: Thanks for keeping me in the loop

myii commented 5 years ago

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

myii commented 5 years ago

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

myii commented 5 years ago

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

saltstack-formulas-travis commented 5 years ago

:tada: This PR is included in version 0.7.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: