rubocop_runner 2.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/README.md +11 -17
- data/lib/rubocop_runner.rb +1 -0
- data/lib/rubocop_runner/rake_task.rb +26 -0
- data/lib/rubocop_runner/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6496eae0006789063c795fdb605512ea77a818f7
|
4
|
+
data.tar.gz: ad9196ee1bcb21cce83302616a0e697cacc65ca9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1bc3c7d665d73db37cd303bca169baf5136dbf4c3d92f29a958611e775004a0669de1090ac803480c82e6a60ba27ca5b84649b0e20ea591c69b3d7f4b06f01c
|
7
|
+
data.tar.gz: 105b51b7973490909180f69aa17224429c30af58cc408504e1e0707e2c9696c3a54e268df985057dd1ac04fbd551ce346a9462e22a08361b5c1682bfb129363a
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# RubocopRunner
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/rubocop_runner.svg)](https://badge.fury.io/rb/rubocop_runner)
|
4
|
+
|
3
5
|
This gem provides means of running rubocop including auto-correct on all files
|
4
6
|
which are currently staged in git. This can be easily used as pre-commit hook
|
5
7
|
with the included template.
|
@@ -8,7 +10,7 @@ If rubocop can fix all detected issues itself via autocorrect it will will do
|
|
8
10
|
so. The commit will abort in this situation.
|
9
11
|
In case rubocop accepts all code changes the commit continues.
|
10
12
|
|
11
|
-
_Although this gem has no tests it's pretty battle tested and is in use
|
13
|
+
_Although this gem has no tests it's pretty battle tested and is in use at runtastic since years._
|
12
14
|
|
13
15
|
## Installation
|
14
16
|
|
@@ -32,33 +34,25 @@ To create a rubocop runner pre-commit hook once just run
|
|
32
34
|
ruby -rrubocop_runner -e "RubocopRunner.install"
|
33
35
|
```
|
34
36
|
|
35
|
-
To make it easy for every developer on the project you can also add
|
37
|
+
To make it easy for every developer on the project you can also add this to your
|
38
|
+
`Rakefile`:
|
36
39
|
|
37
40
|
```ruby
|
38
|
-
|
39
|
-
|
40
|
-
RuboCop::RakeTask.new
|
41
|
-
namespace :rubocop do
|
42
|
-
desc 'Install Rubocop as pre-commit hook'
|
43
|
-
task :install do
|
44
|
-
require 'rubocop_runner'
|
45
|
-
RubocopRunner.install
|
46
|
-
end
|
47
|
-
end
|
48
|
-
rescue LoadError
|
49
|
-
p 'rubocop not installed'
|
50
|
-
end
|
41
|
+
require 'rubocop_runner/rake_task'
|
42
|
+
RubocopRunner::RakeTask.new
|
51
43
|
```
|
52
44
|
|
45
|
+
Afterwards, just run the `rake rubocop:install` task to install the pre-commit
|
46
|
+
hook.
|
47
|
+
|
53
48
|
## ToDo
|
54
49
|
|
55
|
-
- add the install rake task itself to the gem
|
56
50
|
- add tests
|
57
51
|
- improve gem structure
|
58
52
|
|
59
53
|
## Development
|
60
54
|
|
61
|
-
After checking out the repo, run `bin/setup` to install dependencies.
|
55
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
62
56
|
|
63
57
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
64
58
|
|
data/lib/rubocop_runner.rb
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rake'
|
4
|
+
require 'rake/tasklib'
|
5
|
+
|
6
|
+
module RubocopRunner
|
7
|
+
# Provides a custom rake task.
|
8
|
+
#
|
9
|
+
# require "rubocop_runner/rake_task"
|
10
|
+
# RubocopRunner::RakeTask.new
|
11
|
+
class RakeTask < Rake::TaskLib
|
12
|
+
def initialize(name = 'rubocop:install')
|
13
|
+
require 'rubocop/rake_task'
|
14
|
+
RuboCop::RakeTask.new
|
15
|
+
|
16
|
+
desc 'Install Rubocop as pre-commit hook'
|
17
|
+
task(name) do
|
18
|
+
require 'rubocop_runner'
|
19
|
+
RubocopRunner.install
|
20
|
+
end
|
21
|
+
rescue LoadError
|
22
|
+
warn 'rubocop_runner install task disabled due to rubocop not being '\
|
23
|
+
'installed'
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop_runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Eger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -80,6 +80,7 @@ extra_rdoc_files: []
|
|
80
80
|
files:
|
81
81
|
- ".gitignore"
|
82
82
|
- ".rubocop.yml"
|
83
|
+
- CHANGELOG.md
|
83
84
|
- Gemfile
|
84
85
|
- LICENSE.txt
|
85
86
|
- README.md
|
@@ -87,6 +88,7 @@ files:
|
|
87
88
|
- bin/console
|
88
89
|
- bin/setup
|
89
90
|
- lib/rubocop_runner.rb
|
91
|
+
- lib/rubocop_runner/rake_task.rb
|
90
92
|
- lib/rubocop_runner/version.rb
|
91
93
|
- lib/template/pre-commit
|
92
94
|
- rubocop_runner.gemspec
|
@@ -110,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
112
|
version: '0'
|
111
113
|
requirements: []
|
112
114
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.
|
115
|
+
rubygems_version: 2.6.13
|
114
116
|
signing_key:
|
115
117
|
specification_version: 4
|
116
118
|
summary: runs rubocop for all changed files
|