From c682bee5c559bb98fa2afe563dd4c877058fe7ad Mon Sep 17 00:00:00 2001 From: Jonathan Amiez Date: Mon, 24 Oct 2022 12:14:19 +0200 Subject: [PATCH] Use a more recent Rubocop and fix offenses Change-Id: I7474b4c43eeb4d161b66b859c6cb705f5eacb2ce --- .rubocop.yml | 12 +++--------- Gemfile | 2 +- attributes/default.rb | 3 +-- metadata.rb | 2 +- recipes/default.rb | 4 ++-- 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 50f36d6..fef9c80 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,8 +4,7 @@ # - submit the change in the code_generator AllCops: - TargetRubyVersion: 2.4 - + TargetRubyVersion: 2.7 # This requires to alphabetically sort Gem's requirements Bundler/OrderedGems: @@ -17,7 +16,7 @@ Style/FrozenStringLiteralComment: Enabled: false ### Disable line length constraint -Metrics/LineLength: +Layout/LineLength: Max: 180 # Because we're not in the 80s anymore. # Based on data from http://sideeffect.kr/popularconvention#ruby @@ -45,7 +44,7 @@ Style/TrailingCommaInHashLiteral: # } # ### Align hashes as a table -Layout/AlignHash: +Layout/HashAlignment: EnforcedColonStyle: table EnforcedHashRocketStyle: key # When dealing with long key names, it is easier to read hashes in colon @@ -98,11 +97,6 @@ Style/FormatString: Style/MultilineBlockChain: Enabled: false -# We ain't serving subseconds requests. Forcing to use tr instead of gsub will -# be annoying without much value -Performance/StringReplacement: - Enabled: false - # We don't write documentation there at the moment Style/Documentation: Enabled: false diff --git a/Gemfile b/Gemfile index 7ebef4e..afdbb19 100644 --- a/Gemfile +++ b/Gemfile @@ -17,4 +17,4 @@ group :ec2 do end # Other gems should go after this comment -gem 'rubocop', '=0.61.1' +gem 'rubocop', '=1.29.1' diff --git a/attributes/default.rb b/attributes/default.rb index d4e9224..facfebe 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -1,4 +1,3 @@ - default['mariadb']['database']['name'] = 'librenms' default['mariadb']['user_librenms']['username'] = 'librenms' default['mariadb']['user_librenms']['password'] = 'default' @@ -31,7 +30,7 @@ default['librenms']['env']['DB_DATABASE'] = node['mariadb']['database']['name'] default['librenms']['env']['DB_USERNAME'] = node['mariadb']['user_librenms']['username'] default['librenms']['env']['DB_PASSWORD'] = node['mariadb']['user_librenms']['password'] -default['librenms']['env']['APP_URL'] = 'http://' + node['librenms']['web']['name'] + '/' +default['librenms']['env']['APP_URL'] = "http://#{node['librenms']['web']['name']}/" # snmpd default['librenms']['snmp']['community'] = 'public' diff --git a/metadata.rb b/metadata.rb index 4fac9f5..6a79f79 100644 --- a/metadata.rb +++ b/metadata.rb @@ -3,7 +3,7 @@ maintainer_email 'use_github_issues@criteo.com' license 'Apache-2.0' description 'Installs/Configures librenms' -long_description 'This cookbook installs and configure LibreNMS along with the required components (Apache and MySQL). LibreNMS is an autodiscovering PHP/MySQL-based network monitoring system.' +long_description 'Installs and configures LibreNMS along with the required components (Apache and MySQL). LibreNMS is an autodiscovering PHP/MySQL-based network monitoring system.' issues_url 'https://github.com/criteo-cookbooks/librenms/issues' source_url 'https://github.com/criteo-cookbooks/librenms' version '0.2.29' diff --git a/recipes/default.rb b/recipes/default.rb index 1c0cc2d..22ca5d4 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -242,8 +242,8 @@ # enforce right permissions facl dir do - group :'' => 'rwx' - default :group => { :'' => 'rwx' } + group '': 'rwx' + default group: { '': 'rwx' } recurse true end end