Skip to content
This repository has been archived by the owner on Nov 2, 2021. It is now read-only.

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 bbd8f15 commit fb021ce
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,40 @@ puppet-lint-empty_string-check
[![Coverage Status](https://img.shields.io/coveralls/camptocamp/puppet-lint-empty_string-check.svg)](https://coveralls.io/r/camptocamp/puppet-lint-empty_string-check?branch=master)

A puppet-lint plugin to check for variables assigned to the empty string.


## Checks

### Variable assigned to the empty string

The empty string is true in the future parser. `undef` should be used instead for a false value for strings.


#### What you have done

```puppet
$foo = ''
```

#### What you should have done

```puppet
$foo = undef
```

Note: There are valid cases of assigning a variable to the empty string. You should use [control comment](http://puppet-lint.com/controlcomments/) to disable checks for these.


#### Disabling the check

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

```shell
$ puppet-lint --no-empty_string_assignment-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_empty_string_assignment')
```

0 comments on commit fb021ce

Please sign in to comment.