Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Rubocop config #188

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
run: bundle exec rake validate
- name: Run rake lint
run: bundle exec rake lint
- name: Run rake validate
run: bundle exec rake rubocop
- name: Setup Test Matrix
id: get_outputs
run: bundle exec metadata2gha --use-fqdn --pidfile-workaround CentOS
Expand Down
8 changes: 8 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
inherit_gem:
voxpupuli-test: rubocop.yml

Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: consistent_comma

Layout/DotPosition:
EnforcedStyle: leading
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ gem 'puppet-lint-param-docs', '>= 1.3.0', {"groups"=>["test"]}
gem 'puppet-lint-spaceship_operator_without_tag-check', {"groups"=>["test"]}
gem 'puppet-lint-strict_indent-check', {"groups"=>["test"]}
gem 'puppet-lint-undef_in_function-check', {"groups"=>["test"]}
gem 'voxpupuli-test', '~> 1.4'
gem 'voxpupuli-test', '~> 2.1'
gem 'github_changelog_generator', '>= 1.15.0', {"groups"=>["development"]}
gem 'puppet_metadata', '~> 0.3'
gem 'puppet-blacksmith', '>= 6.0.0', {"groups"=>["development"]}
Expand Down
3 changes: 1 addition & 2 deletions lib/puppet/parser/functions/date.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module Puppet::Parser::Functions
newfunction(:date, :type => :rvalue) do
newfunction(:date, type: :rvalue) do
Time.new.strftime('%s')
end
end

4 changes: 2 additions & 2 deletions lib/puppet/parser/functions/get_in_addr_arpa.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Puppet::Parser::Functions
newfunction(:get_in_addr_arpa, :type => :rvalue) do |args|
"#{args[0].split(".").reverse.join(".")}.in-addr.arpa"
newfunction(:get_in_addr_arpa, type: :rvalue) do |args|
"#{args[0].split('.').reverse.join('.')}.in-addr.arpa"
end
end
1 change: 0 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@
Hash[String, Hash] $logging_categories = $dns::params::logging_categories,
Hash[String, Hash] $logging_channels = $dns::params::logging_channels,
) inherits dns::params {

include dns::install
include dns::config
contain dns::service
Expand Down
4 changes: 2 additions & 2 deletions manifests/key.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# The size of the key to generate. Only used when generating the key. It's
# ignored if when a key is specified.
#
define dns::key(
define dns::key (
String $algorithm = 'hmac-md5',
String $filename = "${name}.key",
Optional[String] $secret = undef,
Expand All @@ -27,7 +27,7 @@
$keyfilename = "${keydir}/${filename}"

if $secret {
file {$keyfilename:
file { $keyfilename:
ensure => file,
owner => $dns::user,
group => $dns::group,
Expand Down
8 changes: 4 additions & 4 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@
$listen_on_v6 = 'any'

$recursion = 'yes'
$allow_recursion = [ 'localnets', 'localhost' ]
$allow_query = [ 'any' ]
$allow_recursion = ['localnets', 'localhost']
$allow_query = ['any']

$empty_zones_enable = 'yes'

Expand All @@ -138,8 +138,8 @@
$controls = {
'127.0.0.1' => {
'port' => 953,
'allowed_addresses' => [ '127.0.0.1' ],
'keys' => [ 'rndc-key' ],
'allowed_addresses' => ['127.0.0.1'],
'keys' => ['rndc-key'],
},
}

Expand Down
2 changes: 0 additions & 2 deletions manifests/view.pp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
Boolean $include_defaultzones = true,
String $order = '-',
) {

unless $dns::enable_views {
fail('Must set $dns::enable_views to true in order to use dns::view')
}
Expand Down Expand Up @@ -89,5 +88,4 @@
content => "};\n",
order => "${title}-14",
}

}
1 change: 0 additions & 1 deletion manifests/zone.pp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
Optional[Enum['yes', 'no']] $dnssec_secure_to_insecure = undef,
Optional[Enum['allow', 'maintain', 'off']] $auto_dnssec = undef,
) {

$_contact = pick($contact, "root.${zone}.")

$zonefilename = "${zonefilepath}/${filename}"
Expand Down