danger-hlint 0.0.3 → 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 +4 -4
- data/README.md +23 -2
- data/danger-hlint.gemspec +1 -1
- data/lib/hlint/gem_version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b14607b18e13304e833cac39f07fa838e96eb2cc
|
4
|
+
data.tar.gz: d4d8e7fe9b561c6640b234271c8948af131b4069
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
|
data/danger-hlint.gemspec
CHANGED
@@ -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.
|
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`
|
data/lib/hlint/gem_version.rb
CHANGED
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.
|
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-
|
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.
|
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.
|
82
|
+
version: '0.49'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: yard
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|