inspec-core 4.56.19 → 4.56.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/inspec/cli.rb +2 -0
- data/lib/inspec/profile.rb +7 -5
- data/lib/inspec/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5cd060fe45d6cb0fa653922f1fa8c63e723e8736bfa3c4b821e7a4f1e109fae
|
4
|
+
data.tar.gz: 5c5ceb1b63e19b6311d7ef9a5ce601b98a782397439b3e97dcc4f590c9ca739b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a028a6ea4d48e8eba83804548abc255ac2fb2ecfd76d450223cc24eab43f84382dec1de8813fd7b9f7284ffd1ef7f8a9948724850469296d086dd9c9bb55173
|
7
|
+
data.tar.gz: 534d17549cbf55ffc635a4a9f0689372093debd6f2bbe020f15d606619b451c5441bd2266a8f092024409d0bbe3715d5b7bb7bebf695bba0f23ae2b4112f8553
|
data/lib/inspec/cli.rb
CHANGED
@@ -95,6 +95,8 @@ class Inspec::InspecCLI < Inspec::BaseCLI
|
|
95
95
|
desc "check PATH", "verify all tests at the specified PATH"
|
96
96
|
option :format, type: :string,
|
97
97
|
desc: "The output format to use doc (default), json. If valid format is not provided then it will use the default."
|
98
|
+
option :with_cookstyle, type: :boolean,
|
99
|
+
desc: "Enable or disable cookstyle checks.", default: false
|
98
100
|
profile_options
|
99
101
|
def check(path) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
100
102
|
o = config
|
data/lib/inspec/profile.rb
CHANGED
@@ -103,6 +103,7 @@ module Inspec
|
|
103
103
|
@check_mode = options[:check_mode] || false
|
104
104
|
@parent_profile = options[:parent_profile]
|
105
105
|
@legacy_profile_path = options[:profiles_path] || false
|
106
|
+
@check_cookstyle = options[:with_cookstyle]
|
106
107
|
Metadata.finalize(@source_reader.metadata, @profile_id, options)
|
107
108
|
|
108
109
|
# if a backend has already been created, clone it so each profile has its own unique backend object
|
@@ -593,12 +594,13 @@ module Inspec
|
|
593
594
|
end
|
594
595
|
|
595
596
|
# Running cookstyle to check for code offenses
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
597
|
+
if @check_cookstyle
|
598
|
+
cookstyle_linting_check.each do |lint_output|
|
599
|
+
data = lint_output.split(":")
|
600
|
+
msg = "#{data[-2]}:#{data[-1]}"
|
601
|
+
offense.call(data[0], data[1], data[2], nil, msg)
|
602
|
+
end
|
600
603
|
end
|
601
|
-
|
602
604
|
# profile is valid if we could not find any error & offenses
|
603
605
|
result[:summary][:valid] = result[:errors].empty? && result[:offenses].empty?
|
604
606
|
|
data/lib/inspec/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inspec-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.56.
|
4
|
+
version: 4.56.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef InSpec Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef-telemetry
|