pronto-credo 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef0ebbcdbb7d408c5ae7c6ce51d9384bb6792f31
4
- data.tar.gz: 653890006dc2666b6856040b2752ccf1f5bafb7b
3
+ metadata.gz: 6787f2b2965658403d088e4888414465dda2370c
4
+ data.tar.gz: 608ff10c61e2f5053071e8ce41a291b3ca32f665
5
5
  SHA512:
6
- metadata.gz: 3665574478b208f216b60099fc8eec526fcced1c59805db032b09bd0d7f15a00e4c56581c1b483fa4ff19713b05d7d4f864f2f41489ea19f225cab64a33be29d
7
- data.tar.gz: 40f79874d9a757e31142b9946c127f0fa63dbe0a4a5a4576cb8b1de816fe625f8c25ec237db3678e8e34c8ea3e333131d6b46affbb05480123bcb6e2ece1ae49
6
+ metadata.gz: d08d7d795c18b3d8dcc02d888dfd4335f899068b411869c19a7c8d7fbe18584dd104f42c396d5006c7338ccaa1b7936194333e266d0064199d445c8a55f9df31
7
+ data.tar.gz: 78d9ed88474b58b5613e4e0b75a1ff21886ec447ac46384cc2f18bcc3ad50aa1b0238f4665922ca5634146e6ad07f24e52eca5cf34b8cb02fb46257dbd52433f
@@ -1,3 +1,5 @@
1
+ ## 0.0.8
2
+ - allow strict behaviour for --exit-code https://github.com/carakan/pronto-credo/commit/f1b1620e5e7959833838b8c02de6a7e263df73b9
1
3
  ## 0.0.7
2
4
  - Add environment flag to compile elixir sources https://github.com/carakan/pronto-credo/pull/7
3
5
  ## version 0.0.6
@@ -2,19 +2,32 @@ module Pronto
2
2
  module Credo
3
3
  class OutputParser
4
4
  attr_reader :output, :file
5
- TYPE_WARNINGS = { 'R' => :info,
6
- 'W' => :warning,
7
- 'C' => :info,
8
- 'D' => :info,
9
- 'F' => :info,
10
- 'A' => :info
11
- }
12
5
 
13
6
  def initialize(file, output)
14
7
  @file = file
15
8
  @output = output
16
9
  end
17
10
 
11
+ def type_warnings
12
+ @type_warnings ||= if ENV["PRONTO_CREDO_STRICT"] == "1"
13
+ { 'R' => :warning,
14
+ 'W' => :warning,
15
+ 'C' => :warning,
16
+ 'D' => :warning,
17
+ 'F' => :warning,
18
+ 'A' => :warning
19
+ }
20
+ else
21
+ { 'R' => :info,
22
+ 'W' => :warning,
23
+ 'C' => :info,
24
+ 'D' => :info,
25
+ 'F' => :info,
26
+ 'A' => :info
27
+ }
28
+ end
29
+ end
30
+
18
31
  def parse
19
32
  output.lines.map do |line|
20
33
  line_parts = line.split(':')
@@ -22,10 +35,10 @@ module Pronto
22
35
  offence_in_line = line_parts[1]
23
36
  column_line = nil
24
37
  if line_parts[2].to_i == 0
25
- offence_level = TYPE_WARNINGS[line_parts[2].strip]
38
+ offence_level = type_warnings[line_parts[2].strip]
26
39
  offence_message = line_parts[3..-1].join(':').strip
27
40
  else
28
- offence_level = TYPE_WARNINGS[line_parts[3].strip]
41
+ offence_level = type_warnings[line_parts[3].strip]
29
42
  column_line = line_parts[2].to_i
30
43
  offence_message = line_parts[4..-1].join(':').strip
31
44
  end
@@ -1,5 +1,5 @@
1
1
  module Pronto
2
2
  module Credo
3
- VERSION = '0.0.7'.freeze
3
+ VERSION = '0.0.8'.freeze
4
4
  end
5
5
  end
@@ -10,7 +10,7 @@ module Pronto
10
10
  def run
11
11
  return [] unless @patches
12
12
 
13
- compile if ENV["PRONTO_CREDO_COMPILE"] == 1
13
+ compile if ENV["PRONTO_CREDO_COMPILE"] == "1"
14
14
 
15
15
  @patches.select { |p| p.additions > 0 }
16
16
  .select { |p| elixir_file?(p.new_file_full_path) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pronto-credo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Ramos
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-25 00:00:00.000000000 Z
11
+ date: 2017-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler