Skip to content

Commit

Permalink
Add doc to README
Browse files Browse the repository at this point in the history
  • Loading branch information
raphink committed Jan 8, 2015
1 parent 91def81 commit 7759c35
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,83 @@ puppet-lint-unquoted_string-check
[![Coverage Status](https://img.shields.io/coveralls/camptocamp/puppet-lint-unquoted_string-check.svg)](https://coveralls.io/r/camptocamp/puppet-lint-unquoted_string-check?branch=master)

A puppet-lint plugin to check that selectors and case statements cases are quoted.


## Checks

### Unquoted string in case

Unquoted strings in case statements are not valid with the future parser.

#### What you have done

```puppet
case $::osfamily {
Debian: { }
RedHat: { }
default: { }
}
```

#### What you should have done

```puppet
case $::osfamily {
'Debian': { }
'RedHat': { }
default: { }
}
```

#### Disabling the check

To disable this check, you can add `--no-unquoted_string_in_case-check` to your puppet-lint command line.

```shell
$ puppet-lint --no-unquoted_string_in_case-check path/to/file.pp
```

Alternatively, if you’re calling puppet-lint via the Rake task, you should insert the following line to your `Rakefile`.

```ruby
PuppetLint.configuration.send('disable_unquoted_string_in_case')
```


### Unquoted string in selector

Unquoted strings in selector statements are not valid with the future parser.

#### What you have done

```puppet
$foo = $::osfamily ? {
Debian => 'bar',
RedHat => 'baz',
default => 'qux',
}
```

#### What you should have done

```puppet
$foo = $::osfamily ? {
'Debian' => 'bar',
'RedHat' => 'baz',
default => 'qux',
}
```

#### Disabling the check

To disable this check, you can add `--no-unquoted_string_in_selector-check` to your puppet-lint command line.

```shell
$ puppet-lint --no-unquoted_string_in_selector-check path/to/file.pp
```

Alternatively, if you’re calling puppet-lint via the Rake task, you should insert the following line to your `Rakefile`.

```ruby
PuppetLint.configuration.send('disable_unquoted_string_in_selector')
```

0 comments on commit 7759c35

Please sign in to comment.