face_control 0.5.1 → 0.6.0

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: 82c60e095d36e30438e7fb832f7bb56f6dc2ec51
4
- data.tar.gz: a5c3d87fc9dd1d36be3c4ac4d025b49a29c2c433
3
+ metadata.gz: b374e68daaa27205ecc59c9465ff8f11433bb5d1
4
+ data.tar.gz: 3afdc0deb89bc2e385032c54c950e59d9d1b461d
5
5
  SHA512:
6
- metadata.gz: 5c62e1b7093a9ba1445efb5489b34c0226c92eaec26290e6cf5d489dbe8768fbc111ffb52a8611ebec3aadacb2385f550c4ea2c5ee4d9076bc12a7b54544a308
7
- data.tar.gz: d76ae6ea981b0f49dce11f1f8d65ac1ba244bbf59a846415d5d9566aef22400d67af3fd116c7ac88ffa490ee321092c1521c9c46835aaa8cfd28f876743a04af
6
+ metadata.gz: 1ff712dbd9a72ac6612cd3e20974c82ae8aedb72fe97a00a388b7eab4857d03c0164970b9b156fc160c98ffb1a4b7d1a8e9a295685cf0b3838fd85aacb0fbdc2
7
+ data.tar.gz: 9b7b31b34cc4b460c75066b463cd1bd20cb1752d056f102f490ca15a5b6c7ce86ced03b5265945a0dd5cdacb2ecffbebb2386f97c65842a3d94d7eb3e972b8e7
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Face Control
2
2
 
3
- Comment on added lines of pull requests in [Atlassian Stash](https://www.atlassian.com/software/stash).
3
+ Comment on added lines of pull requests in [Atlassian Stash][].
4
4
  Take comments from static checkers reports.
5
- (Currently supports [RuboCop](http://batsov.com/rubocop/) and [CoffeeLint](http://www.coffeelint.org).)
5
+ (Currently supports [RuboCop][] and [CoffeeLint][].)
6
6
 
7
- Inspired by [Hound](https://houndci.com).
7
+ Inspired by [Hound][].
8
8
 
9
9
  ## Installation
10
10
 
@@ -16,10 +16,59 @@ Inspired by [Hound](https://houndci.com).
16
16
  coffeelint --reporter raw app/assets/javascripts > coffeelint_report.json
17
17
  face-control <project> <repository> <pull_request_id>
18
18
 
19
+ It's natural to run this on a continuous integration server.
20
+ For example, here's a [Jenkins][] project setup:
21
+
22
+ * Source Code Management
23
+ * Git
24
+ * Repositories
25
+ * Refspec:
26
+
27
+ +refs/pull-requests/*:refs/remotes/origin/pull-requests/*
28
+
29
+ (make Jenkins fetch otherwise ignored Stash-created branches)
30
+
31
+ * Branches to build
32
+ * Branch Specifier:
33
+
34
+ origin/pull-requests/*/merge
35
+
36
+ (merge results of open non-conflicting pull requests)
37
+
38
+ * Build
39
+ * Execute shell
40
+ * Command
41
+
42
+ export PULL_REQUEST_ID=`echo $GIT_BRANCH | cut -d / -f 3`
43
+ gem install rubocop face_control
44
+ npm install -g coffeelint
45
+
46
+ rubocop -f json -o rubocop.json || true
47
+ coffeelint --reporter raw app/assets/javascripts > coffeelint_report.json || true
48
+ face-control <project> <repository> $PULL_REQUEST_ID
49
+
50
+ If you don't want to receive RuboCop comments with certain severity level,
51
+ pass the severity in the `--skip-severity` option like so:
52
+
53
+ face-control --skip-severity convention <project> <repository> <pull_request_id>
54
+
55
+ You can use just `-S`.
56
+ You can also pass multiple severity levels as a comma-separated list:
57
+
58
+ face-control -S convention,refactor <project> <repository> <pull_request_id>
59
+
19
60
  `face-control` uses the same configuration file (`~/.stashconfig.yml`)
20
- as the official [Atlassian Stash Command Line Tools](https://bitbucket.org/atlassian/stash-command-line-tools)
61
+ as the official [Atlassian Stash Command Line Tools][]
21
62
  to connect to your Stash instance.
22
63
 
23
64
  ## Etymology
24
65
 
25
- [Face control](http://en.wikipedia.org/wiki/Face_control) in Wikipedia
66
+ [Face control][] in Wikipedia
67
+
68
+ [Hound]: https://houndci.com
69
+ [Atlassian Stash]: https://www.atlassian.com/software/stash
70
+ [Atlassian Stash Command Line Tools]: https://bitbucket.org/atlassian/stash-command-line-tools
71
+ [RuboCop]: http://batsov.com/rubocop/
72
+ [CoffeeLint]: http://www.coffeelint.org
73
+ [Jenkins]: http://jenkins-ci.org
74
+ [Face control]: http://en.wikipedia.org/wiki/Face_control
@@ -1,3 +1,3 @@
1
1
  module FaceControl
2
- VERSION = '0.5.1'
2
+ VERSION = '0.6.0'
3
3
  end
@@ -1,8 +1,8 @@
1
1
  module Stash
2
2
  class PullRequest
3
3
  class Diff
4
- def initialize(raw_diff)
5
- @raw_diff = raw_diff
4
+ def initialize(diff)
5
+ @diff = diff
6
6
  end
7
7
 
8
8
  def added_line?(file, line)
@@ -15,7 +15,7 @@ module Stash
15
15
  @added_lines ||= {}
16
16
  @added_lines[file] ||= begin
17
17
  file_diff(file)['hunks'].map do |hunk|
18
- hunk['segments'].select{ |segment| segment['type'] == 'ADDED' }.map do |segment|
18
+ hunk['segments'].select{|segment| segment['type'] == 'ADDED' }.map do |segment|
19
19
  segment['lines'].map do |line|
20
20
  line['destination']
21
21
  end
@@ -25,7 +25,7 @@ module Stash
25
25
  end
26
26
 
27
27
  def file_diff(file)
28
- @raw_diff['diffs'].detect{ |diff| diff['destination'] && diff['destination']['toString'] == file } || {'hunks' => []}
28
+ @diff['diffs'].detect{|diff| diff['destination'] && diff['destination']['toString'] == file } || {'hunks' => []}
29
29
  end
30
30
  end
31
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: face_control
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Vassilevsky