danger-ormolu 0.0.1 → 0.0.4

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
  SHA256:
3
- metadata.gz: eda05b796b5859ec47645b756e790bcf74eb8728e5743852514f452c9de2ddda
4
- data.tar.gz: 9844706faf4fc9460d8064333236aadb17f804a7c253a2fff6ffc9ee335c85eb
3
+ metadata.gz: 4273427c4e9fd937233da13aa0e80e5b25a6ba74d12537d5e854d5a54413f5f7
4
+ data.tar.gz: 42086450ae735e56dd455d5abdec4d39f9f255b37e72db2f502ac287ac3ead18
5
5
  SHA512:
6
- metadata.gz: f6e7cb24c68611e7c4e3dce3bbaa8a3d776907877a01c4c041acd3ceb8ad7d3a2b193cffef9d214f7ddd50234820a9f660690b7a57a1e6ec46215737586b414a
7
- data.tar.gz: '0289eb2235ed08d737e69a66d9bf7ece07fa12416908068487a4303bbf2e8b9377071a97315b25fd97c83e3091c12896b15a8d5ab23ed9bbf6b1c56a81520b0f'
6
+ metadata.gz: 737e921d5c3779e47b1e1af3602a4e27eebc98a47a46828c32bb52fbfcbb2b6e45c12f44abc17fec3c26739b85149f5c9cf712406f1b0dbd4a52223489bf49ce
7
+ data.tar.gz: 9a14fd34a8044d54bda1484bff011e7aead482419890872a1f90a6a68be842ca254766b29627e6a42db538828c02b189c0156626eb79dab79f022559305575d3
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ormolu
4
- VERSION = '0.0.1'
4
+ VERSION = '0.0.4'
5
5
  end
data/lib/ormolu/plugin.rb CHANGED
@@ -15,24 +15,24 @@ module Danger
15
15
  # @param files [Array<String>]
16
16
  # @return [void]
17
17
  #
18
- def check(files)
18
+ def check(files, path: 'ormolu', args: '', level: :warn)
19
19
  files
20
20
  .each do |file|
21
- result = `ormolu --mode stdout --check-idempotence "#{file}" | diff "#{file}" -`
21
+ result = `#{path} #{args} --mode stdout --check-idempotence "#{file}" | diff "#{file}" -`
22
22
  next if result.empty?
23
23
 
24
24
  extract_diffs(result.lines)
25
25
  .each do |diff|
26
- inconsistence(file, diff[:line], diff[:diff])
26
+ inconsistence(file, diff[:line], diff[:diff], level)
27
27
  end
28
28
  end
29
29
  end
30
30
 
31
31
  private
32
32
 
33
- def inconsistence(file, line, diff)
34
- message = "Style error, fix it through \n\n```haskell\n#{diff}\n``` \n"
35
- warn(message, file: file, line: line)
33
+ def inconsistence(file, line, diff, level)
34
+ message = "Style error, fix it through \n\n```haskell\n#{diff.join}\n``` \n"
35
+ send level, message, file: file, line: line
36
36
  end
37
37
 
38
38
  def extract_diffs(lines)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-ormolu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gautier DI FOLCO
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-15 00:00:00.000000000 Z
11
+ date: 2022-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: danger-plugin-api
@@ -193,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
195
  requirements: []
196
- rubygems_version: 3.1.4
196
+ rubygems_version: 3.2.32
197
197
  signing_key:
198
198
  specification_version: 4
199
199
  summary: A danger plugin for the Haskell code formatter ormolu