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

Tune rubocop Style/WordArray #24

Closed
smortex opened this issue Feb 28, 2022 · 1 comment · Fixed by ccin2p3/modulesync_config#2
Closed

Tune rubocop Style/WordArray #24

smortex opened this issue Feb 28, 2022 · 1 comment · Fixed by ccin2p3/modulesync_config#2

Comments

@smortex
Copy link
Collaborator

smortex commented Feb 28, 2022

Originally posted by @smortex in #15 (comment)

https://docs.rubocop.org/rubocop/cops_style.html#stylewordarray

Suggested change:

Style/WordArray:
  EnforcedStyle: brackets
@smortex smortex changed the title I trend to agree :-) This is tunable in rubocop. Maybe it is worth providing our own rubocop config instead of relying on the one from voxpupuli; or add overrides to rubocop.yml and use modulesync to use this for the in2p3 modules. Tune rubocop Style/WordArray Feb 28, 2022
@smortex
Copy link
Collaborator Author

smortex commented Feb 28, 2022

LGTM:

diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb
index 3fd82bb..43a971a 100644
--- a/spec/classes/init_spec.rb
+++ b/spec/classes/init_spec.rb
@@ -113,7 +113,7 @@ describe 'syslog_ng' do
   context 'When asked to use additional module' do
     let(:params) do
       {
-        modules: %w[foo bar baz]
+        modules: ['foo', 'bar', 'baz']
       }
     end
 
diff --git a/spec/functions/generate_statement_spec.rb b/spec/functions/generate_statement_spec.rb
index 7e9c47c..5687024 100644
--- a/spec/functions/generate_statement_spec.rb
+++ b/spec/functions/generate_statement_spec.rb
@@ -159,7 +159,7 @@ describe 'generate_statement' do
         {
           'type' => 'syslog',
           'options' => [
-            { 'flags' => %w[no-multi-line no-parse] },
+            { 'flags' => ['no-multi-line', 'no-parse'] },
             { 'ip' => ["'10.65.0.5'"] },
             { 'keep-alive' => ['yes'] },
             { 'keep_hostname' => ['yes'] },
diff --git a/spec/unit/facter/syslog_ng_version_spec.rb b/spec/unit/facter/syslog_ng_version_spec.rb
index f5f22f1..dbde2c5 100644
--- a/spec/unit/facter/syslog_ng_version_spec.rb
+++ b/spec/unit/facter/syslog_ng_version_spec.rb
@@ -27,7 +27,7 @@ describe Facter::Util::Fact do
         'Installer-Version' => '3.7.1',
         'Revision' => '',
         'Compile-Date' => 'Aug 17 2015 14:25:00',
-        'Available-Modules' => %w[afamqp basicfuncs linux-kmsg-format csvparser system-source sdjournal afsmtp afmongodb mod-java riemann afsocket cryptofuncs trigger-source afstomp lua confgen rust rss afuser affile afsql dbparser tfgetent geoip-plugin graphite pseudofile mod-perl kvformat grok-parser json-plugin afprog basicfuncs-plus monitor-source syslogformat mod-python date-parser],
+        'Available-Modules' => ['afamqp', 'basicfuncs', 'linux-kmsg-format', 'csvparser', 'system-source', 'sdjournal', 'afsmtp', 'afmongodb', 'mod-java', 'riemann', 'afsocket', 'cryptofuncs', 'trigger-source', 'afstomp', 'lua', 'confgen', 'rust', 'rss', 'afuser', 'affile', 'afsql', 'dbparser', 'tfgetent', 'geoip-plugin', 'graphite', 'pseudofile', 'mod-perl', 'kvformat', 'grok-parser', 'json-plugin', 'afprog', 'basicfuncs-plus', 'monitor-source', 'syslogformat', 'mod-python', 'date-parser'],
         'Enable-Debug' => 'off',
         'Enable-GProf' => 'off',
         'Enable-Memtrace' => 'off',

smortex added a commit to smortex/modulesync_config that referenced this issue Feb 28, 2022
Adjust the configuration to better match ccin2p3 conventions.

Fixes ccin2p3/puppet-syslog_ng#24
Fixes ccin2p3/puppet-syslog_ng#25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant