You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 19, 2020. It is now read-only.
As discussed in #60, the FC035 rule needs some RFC discussion.
There is some reasoning behind not including computations in a template file, and other reasons for including node attributes in the template file.
An example of how a node's attribute could be mutated between the time a template resource declaration and the rendering of said resource is here. This is somewhat a contrived example, and doing this is itself probably an anti-pattern to be mindful of.
This issue is to discuss what should probably be in FC035's logic.
The text was updated successfully, but these errors were encountered:
Passing in a subset (node['ntp']) is more explicit for complex / long templates because you can see more easily what is being accessed. We could check to see if all your attribute usage in the template (ignoring hostname etc) is under a common attribute parent and recommend this. This makes more sense the deeper the level of attribute nesting.
If the template only uses a couple of node attributes then passing them individually as variables is a bit more explicit but probably not worth warning for.
It's been a few years, and I think we've settled into a good enough pattern on when to use node attributes directly in a template vs when not to. Closing
As discussed in #60, the FC035 rule needs some RFC discussion.
There is some reasoning behind not including computations in a template file, and other reasons for including node attributes in the template file.
An example of how a node's attribute could be mutated between the time a template resource declaration and the rendering of said resource is here. This is somewhat a contrived example, and doing this is itself probably an anti-pattern to be mindful of.
This issue is to discuss what should probably be in FC035's logic.
The text was updated successfully, but these errors were encountered: