recipes/slaves_credentials.rb
Favor modifier unless
usage when having a single-line body. Another good alternative is the usage of control flow &&
/||
. Open
Open
unless Chef::Config[:solo]
- Read upRead up
- Exclude checks
Checks for if and unless statements that would fit on one line
if written as a modifier if/unless. The maximum line length is
configured in the Metrics/LineLength
cop.
Example:
# bad
if condition
do_stuff(bar)
end
unless qux.empty?
Foo.do_something
end
# good
do_stuff(bar) if condition
Foo.do_something unless qux.empty?
Use meaningful heredoc delimiters. Open
Open
EOH
- Read upRead up
- Exclude checks
This cop checks that your heredocs are using meaningful delimiters.
By default it disallows END
and EO*
, and can be configured through
blacklisting additional delimiters.
Example:
# good
<<-SQL
SELECT * FROM foo
SQL
# bad
<<-END
SELECT * FROM foo
END
# bad
<<-EOS
SELECT * FROM foo
EOS
Line is too long. [88/80] Open
Open
# Add a global jenkins credential that will use the private key of the jenkins home dir.
- Exclude checks
Line is too long. [112/80] Open
Open
# You must add a private/public key pair (id_rsa and id_rsa.pub) in the jenkins home dir (/var/lib/jenkins/.ssh)
- Exclude checks