Add an option to override ignore private apis#28
Add an option to override ignore private apis#28vStone wants to merge 1 commit intovoxpupuli:masterfrom
Conversation
| PuppetLint.new_check(:parameter_documentation) do | ||
| def check | ||
|
|
||
| ignore_private = PuppetLint.configuration.docs_ignore_private_api.nil? ? true : PuppetLint.configuration.docs_ignore_private_api |
There was a problem hiding this comment.
I looked into a cleaner way to add configuration but it looks like there isn't really a good way. Perhaps it can be simplified to
| ignore_private = PuppetLint.configuration.docs_ignore_private_api.nil? ? true : PuppetLint.configuration.docs_ignore_private_api | |
| ignore_private = PuppetLint.configuration.docs_ignore_private_api.nil? || PuppetLint.configuration.docs_ignore_private_api |
Not sure if it's cleaner. The cleanest way would be to have an API to also add a default.
Perhaps a much better way is to avoid the negative name and name it docs_check_private_params. That can default to false. Since nil and false are equivalent in this case, it would solve the problem.
The only downside is that the unless condition becomes more complex, but overall I think it's a win. Let me know what you think.
There was a problem hiding this comment.
I have no opinion on the naming. adjustments have been made :)
89a8f96 to
53e2f92
Compare
53e2f92 to
cb3a376
Compare
| @@ -1,5 +1,7 @@ | |||
| PuppetLint.new_check(:parameter_documentation) do | |||
| def check | |||
| check_private = PuppetLint.configuration.docs_check_private_params || false | |||
There was a problem hiding this comment.
nil and false evaluate to the same
| check_private = PuppetLint.configuration.docs_check_private_params || false | |
| check_private = PuppetLint.configuration.docs_check_private_params |
| end | ||
|
|
||
| unless is_private | ||
| unless is_private and not check_private |
There was a problem hiding this comment.
Ruby uses && instead of and (same for || vs or)
| unless is_private and not check_private | |
| unless is_private && !check_private |
No description provided.