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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58efdb5e3457dcb1bf97227b98e1f723c672c7eadc995ef3f07b1f2a910c47db
4
- data.tar.gz: 0f789e778551423ccfdacc52dbcda63c597b3e8d83b00739aa36becc52502213
3
+ metadata.gz: c5cd060fe45d6cb0fa653922f1fa8c63e723e8736bfa3c4b821e7a4f1e109fae
4
+ data.tar.gz: 5c5ceb1b63e19b6311d7ef9a5ce601b98a782397439b3e97dcc4f590c9ca739b
5
5
  SHA512:
6
- metadata.gz: 96f3692d1e3dee025002b7e661a635a33cf8ae353e164e2931a6d139d2711c1c94162e69fdc9db52a28fe3a1eb85319f7b08ae27e0f68528603c0e9096a758e2
7
- data.tar.gz: dc1ec6f7322e4cbac56cb1cfe6f6761f44b455c77d069b414c3ec759695ce9ff260deee62c9a0a3184f0a800d31e5fdad8c791bd04fc40bc4d0fafc1fe87f84e
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
@@ -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
- cookstyle_linting_check.each do |lint_output|
597
- data = lint_output.split(":")
598
- msg = "#{data[-2]}:#{data[-1]}"
599
- offense.call(data[0], data[1], data[2], nil, msg)
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
 
@@ -1,3 +1,3 @@
1
1
  module Inspec
2
- VERSION = "4.56.19".freeze
2
+ VERSION = "4.56.20".freeze
3
3
  end
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.19
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-03-23 00:00:00.000000000 Z
11
+ date: 2022-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-telemetry