Ask Your Question
0

Chaining arrows Style not clear enough

asked 2018-03-30 09:29:25 -0500

pacomix gravatar image

Hi! After reading the documentation it is not clear where the resource must be set.

According to this part of the documentation [https://puppet.com/docs/puppet/5.5/st...] the resource must be always to the right of the arrow.

But in this other part of the documentation [https://puppet.com/docs/puppet/5.5/la...], when chaining resource declaratios, they appear in the line immediately below breaking the Style guide rule.

Also puppet-lint complains about this.

Please could you clearly state what is the right form?

edit retag flag offensive close merge delete

Comments

your second link is the style guide, and puppet-lint is supposed to follow it, so it is an implementation issue that puppet-lint sees your second example as 'bad', raise an issue on the puppet-lint repo

DarylW gravatar imageDarylW ( 2018-03-30 12:00:17 -0500 )edit

In both places the text says that the resource must be on the right side but in the second link in the example appears below while in the the first link it shows it as bad . So... is the second link showing an improper style or simply both styles are accepted? It is not clear and contradictory.

pacomix gravatar imagepacomix ( 2018-03-30 12:51:42 -0500 )edit

The second example shows (same line A -> B) or (A [\n] -> B), in both cases, resource B is to the 'right' of the arrow, it's just that the second style allows you to multi-line for readability.

DarylW gravatar imageDarylW ( 2018-03-30 21:13:08 -0500 )edit

Please open the links (have you read both?) and observe that in the second link the resource is at the beginning of a new line.

pacomix gravatar imagepacomix ( 2018-03-31 03:15:19 -0500 )edit

There are a lot of inconsistencies with puppet docs. The style guide is used as a guide. It is not the style constitution, style rulebook, or style handbook. The second example puts the next resource on a new line because it promotes readability. Do what makes sense to you and your team.

ffalor gravatar imageffalor ( 2018-04-01 17:20:35 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-04-03 20:25:53 -0500

Your first link (the style guide) shows the recommended style (which puppet-lint enforces). The second link is the language documentation which shows a syntactically correct example (but with bad style according to the style guide). The example in the second link should be updated to use the style from the style guide.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2018-03-30 09:29:25 -0500

Seen: 62 times

Last updated: Apr 03