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

Fix some Puppet Lint errors #840

Merged
merged 1 commit into from Sep 18, 2014
Merged

Fix some Puppet Lint errors #840

merged 1 commit into from Sep 18, 2014

Conversation

baurmatt
Copy link
Contributor

@baurmatt baurmatt commented Sep 5, 2014

As mention in the subject, i've fixed some Puppet lint errors.

Regards,
Matthias

@igalic
Copy link
Contributor

igalic commented Sep 11, 2014

i'm not really happy with the #lint:ignore:single_quote_string_with_variables solution, tbh.

@baurmatt
Copy link
Contributor Author

Why and do you see any better option?

@igalic
Copy link
Contributor

igalic commented Sep 13, 2014

frankly, i'd ignore those for now.
it doesn't do anything for correctness or readability of the code.

@baurmatt
Copy link
Contributor Author

But it fixes the Puppet Lint errors... Imagine the following scenario: Someones downloading this module from the forge and add it to their internal SVN repository. The SVN repository is configured with an pre-commit hook which blocks the commit if the Puppet Lint test fails.
Yeah you could argue why they're using SVN in the first place or that they should just fix it in there local version, but thats not the point IMHO.
The point is, that Puppet Lint especially allows to ignore certain errors when they're intended design decision and therefore allow people to easier manage theses types of errors.
Since the lines i fixed with these PR are intended design decision, i don't see the point why this should be merged.

if ! defined(Apache::Listen["${listen_addr_port}"]) and $listen_addr_port and $ensure == 'present' {
::apache::listen { "${listen_addr_port}": }
if ! defined(Apache::Listen[$listen_addr_port]) and $listen_addr_port and $ensure == 'present' {
::apache::listen { $listen_addr_port: }
Copy link
Contributor

Choose a reason for hiding this comment

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

These need to be quoted because it will break with the future parser.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh thats interesting, because the tests passed. So i guess there are some future parser tests missing. Will fix this soon.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added travis tests with future parser for Puppet 3.5 with Ruby 1.9.3 and 2.0.0

@underscorgan
Copy link
Contributor

Rather than add the lint exception could you just use double-quoted strings with the $ escaped?

@baurmatt
Copy link
Contributor Author

I wasn't aware that the style guide allows this. From my understanding, a double quoted string is only allowed when variable are included. But my tests showed that i was wrong... :( So its fixed as requested :)

@igalic
Copy link
Contributor

igalic commented Sep 16, 2014

please remove the travis tests, they should be added to https://github.com/puppetlabs/modulesync

@baurmatt
Copy link
Contributor Author

Done.

@@ -76,7 +76,7 @@
}
}

file { "${_loadfile_name}":
file { $_loadfile_name:
Copy link
Contributor

Choose a reason for hiding this comment

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

i'm still confuzzled about what @mhaskel said: how come it doesn't need quoting here?

Copy link
Contributor

Choose a reason for hiding this comment

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

@igalic Since that's just a bare variable (and isn't going to be a number) it doesn't need to be quoted.

underscorgan pushed a commit that referenced this pull request Sep 18, 2014
@underscorgan underscorgan merged commit a39c259 into puppetlabs:master Sep 18, 2014
traylenator added a commit to traylenator/puppetlabs-apache that referenced this pull request Aug 15, 2022
Currently when specifying `docker_users` every user is
both created and added to the docker group.

If `create_user` is false then the users are presumed to exist
via another method outside this module and will only be added to
the docker group.

Fixes puppetlabs#840
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