Skip to content

Commit c845274

Browse files
authored
Merge pull request #120 from dev-sec/newlint
Change linting to Cookstyle
2 parents 6bcfe60 + 87009dc commit c845274

30 files changed

+86
-118
lines changed

.rubocop.yml

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,3 @@
22
AllCops:
33
Exclude:
44
- vendor/**/*
5-
Documentation:
6-
Enabled: false
7-
Layout/ParameterAlignment:
8-
Enabled: true
9-
HashSyntax:
10-
Enabled: true
11-
LineLength:
12-
Enabled: false
13-
EmptyLinesAroundBlockBody:
14-
Enabled: false
15-
Style/Encoding:
16-
Enabled: false
17-
MethodLength:
18-
Max: 40
19-
NumericLiterals:
20-
MinDigits: 10
21-
Metrics/BlockLength:
22-
Max: 45 # needed for 6.1.1
23-
Metrics/CyclomaticComplexity:
24-
Max: 10
25-
Metrics/PerceivedComplexity:
26-
Max: 10
27-
Metrics/AbcSize:
28-
Max: 30
29-
# Lint/AmbiguousBlockAssociation is incompatible with RSpec
30-
# https://github.com/rubocop-hq/rubocop/issues/4222
31-
Lint/AmbiguousBlockAssociation:
32-
Enabled: false
33-
Lint/AmbiguousRegexpLiteral:
34-
Enabled: false
35-
Style/NumericPredicate:
36-
Enabled: false

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
source 'https://rubygems.org'
44

5+
gem 'cookstyle'
56
gem 'highline'
67
gem 'rack'
78
gem 'rake'

Rakefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# frozen_string_literal: true
22

3+
require 'cookstyle'
34
require 'rake/testtask'
45
require 'rubocop/rake_task'
56

@@ -9,6 +10,10 @@ task :rubocop do
910
RuboCop::RakeTask.new
1011
end
1112

13+
RuboCop::RakeTask.new(:cookstyle) do |task|
14+
task.options << '--display-cop-names'
15+
end
16+
1217
# lint the project
1318
desc 'Run robocop linter'
1419
task lint: [:rubocop]

controls/1_1_filesystem_configuration.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
#
4-
# Copyright 2017, Schuberg Philis B.V.
4+
# Copyright:: 2017, Schuberg Philis B.V.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -230,7 +230,6 @@
230230
describe mount('/var/tmp') do
231231
its('options') { should include 'nodev' }
232232
end
233-
234233
end
235234

236235
control 'cis-dil-benchmark-1.1.9' do
@@ -248,7 +247,6 @@
248247
describe mount('/var/tmp') do
249248
its('options') { should include 'nosuid' }
250249
end
251-
252250
end
253251

254252
control 'cis-dil-benchmark-1.1.10' do
@@ -266,7 +264,6 @@
266264
describe mount('/var/tmp') do
267265
its('options') { should include 'noexec' }
268266
end
269-
270267
end
271268

272269
control 'cis-dil-benchmark-1.1.11' do

controls/1_2_configure_software_updates.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
#
4-
# Copyright 2017, Schuberg Philis B.V.
4+
# Copyright:: 2017, Schuberg Philis B.V.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.

controls/1_3_filesystem_integrity_checking.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
#
4-
# Copyright 2017, Schuberg Philis B.V.
4+
# Copyright:: 2017, Schuberg Philis B.V.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -48,13 +48,13 @@
4848
tag level: 1
4949

5050
describe.one do
51-
%w[/var/spool/cron/crontabs/root /var/spool/cron/root /etc/crontab].each do |f|
51+
%w(/var/spool/cron/crontabs/root /var/spool/cron/root /etc/crontab).each do |f|
5252
describe file(f) do
5353
its('content') { should match(/aide (--check|-C)/) }
5454
end
5555
end
5656

57-
%w[cron.d cron.hourly cron.daily cron.weekly cron.monthly].each do |f|
57+
%w(cron.d cron.hourly cron.daily cron.weekly cron.monthly).each do |f|
5858
command("find /etc/#{f} -type f").stdout.split.each do |entry|
5959
describe file(entry) do
6060
its('content') { should match(/aide (--check|-C)/) }

controls/1_4_secure_boot_settings.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
#
4-
# Copyright 2017, Schuberg Philis B.V.
4+
# Copyright:: 2017, Schuberg Philis B.V.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.

controls/1_5_additional_process_hardening.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
#
4-
# Copyright 2017, Schuberg Philis B.V.
4+
# Copyright:: 2017, Schuberg Philis B.V.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.

controls/1_6_mandatory_access_control.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
#
4-
# Copyright 2017, Schuberg Philis B.V.
4+
# Copyright:: 2017, Schuberg Philis B.V.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -30,7 +30,7 @@
3030
tag level: 2
3131

3232
describe.one do
33-
%w[libselinux libselinux1 apparmor].each do |p|
33+
%w(libselinux libselinux1 apparmor).each do |p|
3434
describe package(p) do
3535
it { should be_installed }
3636
end
@@ -49,7 +49,7 @@
4949
tag level: 2
5050

5151
describe.one do
52-
%w[/boot/grub2/grub.cfg /boot/grub/menu.lst].each do |f|
52+
%w(/boot/grub2/grub.cfg /boot/grub/menu.lst).each do |f|
5353
describe file(f) do
5454
its('content') { should_not match /selinux=0/ }
5555
its('content') { should_not match /enforcing=0/ }

controls/1_7_warning_banners.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
#
4-
# Copyright 2017, Schuberg Philis B.V.
4+
# Copyright:: 2017, Schuberg Philis B.V.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)