https://github.com/dodevops/puppet-lint-param_comment-check
An extensive, opinionated puppet lint check for valid parameter comments
https://github.com/dodevops/puppet-lint-param_comment-check
Last synced: 2 months ago
JSON representation
An extensive, opinionated puppet lint check for valid parameter comments
- Host: GitHub
- URL: https://github.com/dodevops/puppet-lint-param_comment-check
- Owner: dodevops
- License: mit
- Created: 2022-05-30T11:57:48.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-09-05T07:55:12.000Z (almost 3 years ago)
- Last Synced: 2025-02-18T17:54:06.816Z (over 1 year ago)
- Language: Ruby
- Size: 78.1 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Puppet lint param check
This is an extensive, opinionated check for valid parameter comments. It checks if the following criteria are matched:
- All parameters are documented
- @param-tags are separated from another by one empty line
- The description of a @param tag is always indented in the next line
- The @option comments directly follow the corresponding hash @param tag without a separator
- @param tags are sorted like the parameters they document
```
# @param mandatory
# A mandatory parameter
# @option mandatory [String] hashkey
# A key of the hash "mandatory" named "hashkey".
#
# @param withdefault
# A parameter with a default value
#
# @param optional
# An optional parameter
class my_class {
Hash $mandatory,
Boolean $withdefault = false,
Optional[String] $optional = undef,
```
## Development
This check uses a finite state machine to work through the expected list of parameters.
The workflow used by the fsm can be visualized like this:

## Usage
To use the plugin, add the following line to the Gemfile:
gem 'puppet-lint-param_comment-check'