danger-hlint 0.0.3 → 0.0.4

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
  SHA1:
3
- metadata.gz: bd14c1da49d7c97a0f54878aa2ad2e3f9d7b7485
4
- data.tar.gz: 0e03a82a957390f5cef8b47b2e31559d684cbb8d
3
+ metadata.gz: b14607b18e13304e833cac39f07fa838e96eb2cc
4
+ data.tar.gz: d4d8e7fe9b561c6640b234271c8948af131b4069
5
5
  SHA512:
6
- metadata.gz: 4ba752949ec302c3244e0417fc18739231e939cce135c4a77f0041208a9134a316382435634464bcd3c1d702ac9d1ccf6ad392cd5b006e3d0131097f2b045b09
7
- data.tar.gz: 4cd241884902f3faa17c8c7764fdedcbbed6998f6d734f035995856a49723c3be76e58bdb4260c80525277e65ff19fe97961cba8dcaf88d943487eda6ab74809
6
+ metadata.gz: c41a1ec511a1bc304a1176334dbbfe75e93acc7ac85b8c168f2ace9f93fb1115e17ea99873eb0ea2a052ffd882db6855326b78d4125041df1a7aaf4bf3ce9d0d
7
+ data.tar.gz: f74fbbb422f5693f13b0fed6cdda2acc484c7edfb6ae5c681f080bf38a7c3f871346e69dd7d96aded990809b549d190649bfb39980117b71fafc35785bd70370
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  A Danger plugin for [HLint](https://github.com/ndmitchell/hlint)
4
4
 
5
+ Read a full how to at [http://allocinit.io/haskell/danger-and-hlint/](http://allocinit.io/haskell/danger-and-hlint/)
6
+
5
7
  ## Installation
6
8
 
7
9
  Add this line to your Gemfile:
@@ -18,10 +20,18 @@ your `Dangerfile` under the `hlint` namespace.
18
20
  At the moment one single method is exposed: `hlint.lint`
19
21
 
20
22
  If you want the lint results to show in the diff instead of in the comments, you can use then `inline_mode` option.
21
- Violations that occur out of the diff will show in danger's fail or warn section.
23
+ Violations that occur out of the diff will show in danger's fail or warn section. Here's a minimal example of what to add to your `Dangerfile` (read the inline comments):
22
24
 
23
25
  ```ruby
24
- hlint.lint files inline_mode: true
26
+ # get all affected files by the changes in the current diff
27
+ affected_files = git.added_files + git.modified_files
28
+
29
+ # limit files to .hs files
30
+ haskell_files = affected_files.select { |file| file.end_with?('.hs') }
31
+
32
+ # run hlint on the files and comment inline in the PR
33
+ hlint.lint haskell_files, inline_mode: true
34
+
25
35
  ```
26
36
 
27
37
  To pass other parameters to the linter just add them to the method call. The
@@ -39,6 +49,17 @@ To pass switches to the linter (like `--quiet`) specify `true` as the value in t
39
49
  hlint.lint files quiet: true
40
50
  ```
41
51
 
52
+ ## Warning
53
+
54
+ When running `danger-hlint` on your CI server **(especially CircleCI 2.0)** make sure that the `hlint` binary is in your `PATH`, else this plugin will silently fail to produce any linting output. One possibele way to do this (in CircleCI 2.0) is:
55
+
56
+ ```
57
+ - run:
58
+ name: "Running HLint (via danger-hlint)"
59
+ command: |
60
+ export PATH="$HOME/.local/bin:$PATH"
61
+ bundle exec danger
62
+ ```
42
63
 
43
64
  ## Development
44
65
 
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.add_development_dependency 'rspec', '~> 3.4'
29
29
 
30
30
  # Linting code and docs
31
- spec.add_development_dependency "rubocop", "~> 0.41"
31
+ spec.add_development_dependency "rubocop", "~> 0.49"
32
32
  spec.add_development_dependency "yard", "~> 0.8"
33
33
 
34
34
  # Makes testing easy via `bundle exec guard`
@@ -1,3 +1,3 @@
1
1
  module Hlint
2
- VERSION = '0.0.3'.freeze
2
+ VERSION = '0.0.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-hlint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tommaso Piazza
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-11 00:00:00.000000000 Z
11
+ date: 2017-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: danger-plugin-api
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0.41'
75
+ version: '0.49'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0.41'
82
+ version: '0.49'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: yard
85
85
  requirement: !ruby/object:Gem::Requirement