pronto 0.4.1 → 0.4.2

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: bcb19e8ce6c3a9ad363f36c5adebe0fcf52989a0
4
- data.tar.gz: 4d604a06ca0242a2e271a06c2a2eed4ef80a3631
3
+ metadata.gz: 9149bddf536219f6ce110152983b12b8e3249957
4
+ data.tar.gz: f8c8c629426c28bad4d33e0eb957769cdd61cc4a
5
5
  SHA512:
6
- metadata.gz: 952bbf877a557e9d4c62809ecd2d9130c384bc2799d18f28925b6014a668e21c6c5b76dcb4099ecd7b81d1fd99b58752c89626c0783a0c2633c15cdc2ea028c7
7
- data.tar.gz: ef98e4da18e5196a9c49d899471631a2f11683e77f93ea02c86ac6efdd42f67fe1e689715809e191613eab75fff5fd12828d19d4dba83c5ca47d5ee268827cea
6
+ metadata.gz: fb990d2399c3d425d21caab02aaee8122441ed4fed6dab984f02725f508468bfa0e57852642ebe9d5b36a0e5f88156de678796a7f8954ee3ace2dcf7bf6b4e57
7
+ data.tar.gz: a2471ed52d16972c70403c2ca4ef312bd30183a8bef915344098e66896cf64c377ad5928e57bd63b3d5d5d751a8110d742144a1664a44407523eaef63667731c
data/README.md CHANGED
@@ -17,6 +17,29 @@ to your [styleguide](https://github.com/mmozuras/pronto-rubocop), [are DRY](http
17
17
 
18
18
  Pronto runs the checks on a diff between the current HEAD and the provided commit-ish (default is master).
19
19
 
20
+ ### Local Changes
21
+
22
+ You can run Pronto locally. First, install Pronto and the runners you want to use:
23
+ ```bash
24
+ gem install pronto
25
+ gem install pronto-rubocop
26
+ ```
27
+ Then navigate to the repository you want to run Pronto on, and:
28
+ ```bash
29
+ git checkout feature/branch
30
+
31
+ # Analyze diff of committed changes on current branch and master:
32
+ pronto run
33
+
34
+ # Analyze diff of uncommitted changes and master:
35
+ pronto run --index
36
+
37
+ # Analyze *all* changes since the *initial* commit (may take some time):
38
+ pronto run --commit=$(git log --pretty=format:%H | tail -1)
39
+ ```
40
+
41
+ Just run `pronto` without any arguments to see what Pronto is capable of.
42
+
20
43
  ### GitHub Integration
21
44
 
22
45
  You can run Pronto as a step of your CI builds and get the results as comments
@@ -92,35 +115,20 @@ formatter = Pronto::Formatter::GitlabFormatter.new
92
115
  Pronto.run('origin/master', '.', formatter)
93
116
  ```
94
117
 
95
- ### Local Changes
96
-
97
- You can run Pronto locally. First, install Pronto and the runners you want to use:
98
- ```bash
99
- gem install pronto
100
- gem install pronto-rubocop
101
- ```
102
- Then navigate to the repository you want to run Pronto on, and:
103
- ```bash
104
- git checkout feature/branch
105
- pronto run # Pronto runs against master by default
106
- ```
107
-
108
- Just run `pronto` without any arguments to see what Pronto is capable off.
109
-
110
118
  ## Runners
111
119
 
112
120
  Pronto can run various tools and libraries, as long as there's a runner for it.
113
121
  Currently available:
114
122
 
115
- * [pronto-rubocop](https://github.com/mmozuras/pronto-rubocop)
116
- * [pronto-flay](https://github.com/mmozuras/pronto-flay)
117
123
  * [pronto-brakeman](https://github.com/mmozuras/pronto-brakeman)
124
+ * [pronto-coffeelint](https://github.com/siebertm/pronto-coffeelint)
125
+ * [pronto-flay](https://github.com/mmozuras/pronto-flay)
118
126
  * [pronto-foodcritic](https://github.com/mmozuras/pronto-foodcritic)
119
- * [pronto-rails_best_practices](https://github.com/mmozuras/pronto-rails_best_practices)
120
- * [pronto-reek](https://github.com/mmozuras/pronto-reek)
121
- * [pronto-poper](https://github.com/mmozuras/pronto-poper)
122
127
  * [pronto-jshint](https://github.com/mmozuras/pronto-jshint)
123
- * [pronto-spell](https://github.com/mmozuras/pronto-spell)
124
128
  * [pronto-haml](https://github.com/mmozuras/pronto-haml)
129
+ * [pronto-poper](https://github.com/mmozuras/pronto-poper)
130
+ * [pronto-rails_best_practices](https://github.com/mmozuras/pronto-rails_best_practices)
131
+ * [pronto-reek](https://github.com/mmozuras/pronto-reek)
132
+ * [pronto-rubocop](https://github.com/mmozuras/pronto-rubocop)
125
133
  * [pronto-scss](https://github.com/mmozuras/pronto-scss)
126
- * [pronto-coffeelint](https://github.com/siebertm/pronto-coffeelint)
134
+ * [pronto-spell](https://github.com/mmozuras/pronto-spell)
@@ -20,6 +20,7 @@ require 'pronto/formatter/github_formatter'
20
20
  require 'pronto/formatter/github_pull_request_formatter'
21
21
  require 'pronto/formatter/gitlab_formatter'
22
22
  require 'pronto/formatter/checkstyle_formatter'
23
+ require 'pronto/formatter/null_formatter'
23
24
  require 'pronto/formatter/formatter'
24
25
 
25
26
  module Pronto
@@ -33,7 +34,8 @@ module Pronto
33
34
 
34
35
  result = run_all_runners(patches)
35
36
 
36
- puts formatter.format(result, repo)
37
+ formatted = formatter.format(result, repo)
38
+ puts formatted if formatted
37
39
 
38
40
  result
39
41
  end
@@ -49,8 +51,8 @@ module Pronto
49
51
  end
50
52
 
51
53
  gems.map { |gem| gem.name.sub(/^pronto-/, '') }
52
- .uniq
53
- .sort
54
+ .uniq
55
+ .sort
54
56
  end
55
57
 
56
58
  private
@@ -15,7 +15,8 @@ module Pronto
15
15
  'gitlab' => GitlabFormatter,
16
16
  'json' => JsonFormatter,
17
17
  'checkstyle' => CheckstyleFormatter,
18
- 'text' => TextFormatter
18
+ 'text' => TextFormatter,
19
+ 'null' => NullFormatter
19
20
  }
20
21
  end
21
22
  end
@@ -0,0 +1,8 @@
1
+ module Pronto
2
+ module Formatter
3
+ class NullFormatter
4
+ def format(_, _)
5
+ end
6
+ end
7
+ end
8
+ end
@@ -1,6 +1,6 @@
1
1
  module Pronto
2
2
  module Git
3
- class Line < Struct.new(:line, :patch, :hunk)
3
+ Line = Struct.new(:line, :patch, :hunk) do
4
4
  extend Forwardable
5
5
 
6
6
  def_delegators :line, :addition?, :deletion?, :content, :new_lineno,
@@ -1,6 +1,6 @@
1
1
  module Pronto
2
2
  module Git
3
- class Patch < Struct.new(:patch, :repo)
3
+ Patch = Struct.new(:patch, :repo) do
4
4
  extend Forwardable
5
5
 
6
6
  def_delegators :patch, :delta, :hunks, :stat
@@ -14,7 +14,7 @@ module Pronto
14
14
  end
15
15
 
16
16
  def blame(lineno)
17
- repo.blame(self, lineno)
17
+ repo.blame(new_file_path, lineno)
18
18
  end
19
19
 
20
20
  def lines
@@ -34,7 +34,13 @@ module Pronto
34
34
  end
35
35
 
36
36
  def new_file_full_path
37
- repo.path.join(delta.new_file[:path])
37
+ repo.path.join(new_file_path)
38
+ end
39
+
40
+ private
41
+
42
+ def new_file_path
43
+ delta.new_file[:path]
38
44
  end
39
45
  end
40
46
  end
@@ -44,11 +44,10 @@ module Pronto
44
44
  Pathname.new(@repo.path).parent
45
45
  end
46
46
 
47
- def blame(patch, lineno)
48
- Rugged::Blame.new(@repo, patch.delta.new_file[:path],
49
- min_line: lineno, max_line: lineno,
50
- track_copies_same_file: true,
51
- track_copies_any_commit_copies: true)[0]
47
+ def blame(path, lineno)
48
+ Rugged::Blame.new(@repo, path, min_line: lineno, max_line: lineno,
49
+ track_copies_same_file: true,
50
+ track_copies_any_commit_copies: true)[0]
52
51
  end
53
52
 
54
53
  def branch
@@ -67,7 +67,7 @@ module Pronto
67
67
  ENV['GITHUB_ACCESS_TOKEN']
68
68
  end
69
69
 
70
- class Comment < Struct.new(:sha, :body, :path, :position)
70
+ Comment = Struct.new(:sha, :body, :path, :position) do
71
71
  def ==(other)
72
72
  position == other.position &&
73
73
  path == other.path &&
@@ -44,7 +44,7 @@ module Pronto
44
44
  ENV['GITLAB_API_ENDPOINT']
45
45
  end
46
46
 
47
- class Comment < Struct.new(:sha, :note, :path, :line)
47
+ Comment = Struct.new(:sha, :note, :path, :line) do
48
48
  def ==(other)
49
49
  line == other.line &&
50
50
  path == other.path &&
@@ -1,3 +1,3 @@
1
1
  module Pronto
2
- VERSION = '0.4.1'
2
+ VERSION = '0.4.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pronto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mindaugas Mozūras
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-29 00:00:00.000000000 Z
11
+ date: 2015-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rugged
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.21.0
19
+ version: 0.22.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.21.0
26
+ version: 0.22.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: thor
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,70 +44,84 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.2'
47
+ version: 3.8.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.2'
54
+ version: 3.8.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: gitlab
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3.3'
61
+ version: 3.4.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3.3'
68
+ version: 3.4.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '10.3'
75
+ version: 10.4.0
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: '10.3'
82
+ version: 10.4.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '3.0'
89
+ version: 3.2.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '3.0'
96
+ version: 3.2.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rspec-its
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '1.0'
103
+ version: 1.2.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '1.0'
110
+ version: 1.2.0
111
+ - !ruby/object:Gem::Dependency
112
+ name: rspec-expectations
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 3.2.0
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 3.2.0
111
125
  description: |2
112
126
  Pronto runs analysis quickly by checking only the relevant changes. Created
113
127
  to be used on pull requests, but suited for other scenarios as well. Perfect
@@ -130,6 +144,7 @@ files:
130
144
  - lib/pronto/formatter/github_pull_request_formatter.rb
131
145
  - lib/pronto/formatter/gitlab_formatter.rb
132
146
  - lib/pronto/formatter/json_formatter.rb
147
+ - lib/pronto/formatter/null_formatter.rb
133
148
  - lib/pronto/formatter/text_formatter.rb
134
149
  - lib/pronto/git/line.rb
135
150
  - lib/pronto/git/patch.rb
@@ -142,7 +157,7 @@ files:
142
157
  - lib/pronto/rake_task/travis_pull_request.rb
143
158
  - lib/pronto/runner.rb
144
159
  - lib/pronto/version.rb
145
- homepage: http://github.org/mmozuras/pronto
160
+ homepage: http://github.com/mmozuras/pronto
146
161
  licenses:
147
162
  - MIT
148
163
  metadata: {}
@@ -162,9 +177,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
177
  version: 1.3.6
163
178
  requirements: []
164
179
  rubyforge_project:
165
- rubygems_version: 2.2.2
180
+ rubygems_version: 2.4.5
166
181
  signing_key:
167
182
  specification_version: 4
168
183
  summary: Pronto runs analysis by checking only the introduced changes
169
184
  test_files: []
170
- has_rdoc: