firespring_dev_commands 2.1.16.pre.alpha.1 → 2.1.16.pre.alpha.2

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: 5aefeda65512010d23b7d8ebac7ea669fcd2594a8b9b395a5de0d25862f0a3a8
4
- data.tar.gz: 2edd1f29077209e1ab7822779bf952a92ecbd1e2a957a1c12334b2a00d6ebbb4
3
+ metadata.gz: f810b97efdfffe33d29fc32b31c63e59e988e4c7b11e82d68a4cd6e85262a7b0
4
+ data.tar.gz: 965832c284d5276501f658c5a0d7d70c6a4b4f88ef84c834011bc4b6bdb1cd6f
5
5
  SHA512:
6
- metadata.gz: afe5f89c78a0263a41a30442e875eb8e690c5912cf8ef00f499648556de5e3af22384f16ff67ff0519a0682b84ec98d8d28c6e8cffe979a208e65264f9b7ec6d
7
- data.tar.gz: 2adc381033fe2505a7189fe817b1e7a51b98df017dca422420aea90dde27f689dddca1dcfd26a8de708e9cb99987c9ac055343f708a7a71c9ea4bdb7ab7619e4
6
+ metadata.gz: ea9ffaa8921ed4c75f1e0c3c9262167fa45faa382d0d9074c22d4aa6a4318856dc380a7f23f5ce2b09e5a20197af193e587f102ded1bc09447c81c6a87aac092
7
+ data.tar.gz: ad5e684614fb9bcadba6a6a975712bf1a6ccd4d27687cb3e1288fd8efc34bea5cb1285c4da47b12f7a72f1eb283bb71f0e6bbae604ae071bb7d3d0eadbac9b69
@@ -3,11 +3,12 @@ module Dev
3
3
  class Audit
4
4
  # The class containing standardized information about an audit report
5
5
  class Report
6
- attr_accessor :items, :min_severity, :ignorelist, :filtered_items
6
+ attr_accessor :items, :min_severity, :error_on_unknown, :ignorelist, :filtered_items
7
7
 
8
8
  def initialize(
9
9
  items,
10
10
  min_severity: ENV.fetch('MIN_SEVERITY', nil),
11
+ error_on_unknown: ENV.fetch('ERROR_ON_UNKNOWN', nil),
11
12
  ignorelist: ENV['IGNORELIST'].to_s.split(/\s*,\s*/)
12
13
  )
13
14
  # Items should be an array of Item objects
@@ -15,12 +16,18 @@ module Dev
15
16
  raise 'items must all be report items' unless @items.all?(Dev::Audit::Report::Item)
16
17
 
17
18
  @min_severity = min_severity || Level::HIGH
19
+ @error_on_unknown = error_on_unknown
18
20
  @ignorelist = Array(ignorelist).compact
19
21
  end
20
22
 
21
23
  # Get all severities greater than or equal to the minimum severity
22
24
  def desired_severities
23
- LEVELS.slice(LEVELS.find_index(min_severity)..-1)
25
+ max_severity = if error_on_unknown.to_s.strip == 'true'
26
+ -1
27
+ else
28
+ -2
29
+ end
30
+ LEVELS.slice(LEVELS.find_index(min_severity)..max_severity)
24
31
  end
25
32
 
26
33
  # Run the filters against the report items and filter out any which should be excluded
@@ -6,6 +6,6 @@ module Dev
6
6
  # Use 'v.v.v.pre.alpha.v' for pre-release vesions
7
7
  # Use 'v.v.v.beta.v for beta versions
8
8
  # Use semantic versioning for any releases (https://semver.org/)
9
- VERSION = '2.1.16.pre.alpha.1'.freeze
9
+ VERSION = '2.1.16.pre.alpha.2'.freeze
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: firespring_dev_commands
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.16.pre.alpha.1
4
+ version: 2.1.16.pre.alpha.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Firespring