rubocop-migrations 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.travis.yml +5 -0
- data/Appraisals +15 -0
- data/README.md +32 -12
- data/Rakefile +11 -4
- data/gemfiles/.bundle/config +2 -0
- data/gemfiles/latest_rubocop.gemfile +7 -0
- data/gemfiles/rubocop_0.41.gemfile +7 -0
- data/gemfiles/rubocop_0.42.gemfile +7 -0
- data/gemfiles/rubocop_0.43.gemfile +7 -0
- data/lib/rubocop/migrations/version.rb +1 -1
- data/rubocop-migrations.gemspec +3 -2
- metadata +28 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6cfad4f333654b8a78574c04ff6cb9e154557813
|
4
|
+
data.tar.gz: 88d16496aeeb6ffbe37296f4fa16966dcc7aa84b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67b0e195615c1109824f8402576892f1e5ad233a253ac94ffe1242ba8fc00af2c310ec7c1ed68c1431db3cf659097110cb0865781f5dfbafa136d4bdfdabca66
|
7
|
+
data.tar.gz: 2180325201612f1bc454ca4dc1f32b4cfdacc2375ed7d8d81ee84e31537ba81a7ec590c4df7ac04970892d4bc7a1803fa78aa13d2f46972b3ee08526bf20e83a
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/Appraisals
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
appraise 'rubocop-0.41' do
|
2
|
+
gem 'rubocop', '~> 0.41.0'
|
3
|
+
end
|
4
|
+
|
5
|
+
appraise 'rubocop-0.42' do
|
6
|
+
gem 'rubocop', '~> 0.42.0'
|
7
|
+
end
|
8
|
+
|
9
|
+
appraise 'rubocop-0.43' do
|
10
|
+
gem 'rubocop', '~> 0.43.0'
|
11
|
+
end
|
12
|
+
|
13
|
+
appraise 'latest-rubocop' do
|
14
|
+
gem 'rubocop'
|
15
|
+
end
|
data/README.md
CHANGED
@@ -1,12 +1,15 @@
|
|
1
1
|
# RuboCop Migrations
|
2
2
|
|
3
|
-
Rails migrations analysis as a extension
|
3
|
+
Rails migrations analysis as a extension
|
4
|
+
of [RuboCop](https://github.com/bbatsov/rubocop). Heavily inspired
|
5
|
+
by [`rubocop-cask`](https://github.com/caskroom/rubocop-cask) which in turn is
|
6
|
+
inspired by [`rubocop-rspec`](https://github.com/nevir/rubocop-rspec).
|
4
7
|
|
5
8
|
## Installation
|
6
9
|
|
7
10
|
Just install the `rubocop-migrations` gem
|
8
11
|
|
9
|
-
```
|
12
|
+
```shell
|
10
13
|
gem install rubocop-migrations
|
11
14
|
```
|
12
15
|
|
@@ -19,7 +22,8 @@ gem 'rubocop-migrations'
|
|
19
22
|
|
20
23
|
## Usage
|
21
24
|
|
22
|
-
You need to tell RuboCop to load the Migrations extension. There are three ways
|
25
|
+
You need to tell RuboCop to load the Migrations extension. There are three ways
|
26
|
+
to do this:
|
23
27
|
|
24
28
|
### RuboCop configuration file
|
25
29
|
|
@@ -29,19 +33,23 @@ Put this into your `.rubocop.yml`:
|
|
29
33
|
require: rubocop/migrations
|
30
34
|
```
|
31
35
|
|
32
|
-
Now you can run `rubocop` and it will automatically load the RuboCop Migrations
|
36
|
+
Now you can run `rubocop` and it will automatically load the RuboCop Migrations
|
37
|
+
cops together with the standard cops.
|
33
38
|
|
34
39
|
### Command line
|
35
40
|
|
36
|
-
```
|
41
|
+
```shell
|
37
42
|
rubocop --require rubocop/migrations
|
38
43
|
```
|
39
44
|
|
40
45
|
## The Cop
|
41
46
|
|
42
|
-
All cops are located
|
47
|
+
All cops are located
|
48
|
+
under [`lib/rubocop/cop/migrations`](lib/rubocop/cop/migrations), and contain
|
49
|
+
examples/documentation.
|
43
50
|
|
44
|
-
In your `.rubocop.yml`, you may treat the Cask cops just like any other cop. For
|
51
|
+
In your `.rubocop.yml`, you may treat the Cask cops just like any other cop. For
|
52
|
+
example:
|
45
53
|
|
46
54
|
```yaml
|
47
55
|
Migrations/RemoveIndex:
|
@@ -56,13 +64,25 @@ Migrations/RemoveIndex:
|
|
56
64
|
4. Push to the branch (`git push origin my-new-feature`)
|
57
65
|
5. Create new Pull Request
|
58
66
|
|
59
|
-
|
67
|
+
### Running the tests
|
60
68
|
|
61
|
-
|
62
|
-
|
69
|
+
We use Appraisals in order to run the tests with different rubocop versions to
|
70
|
+
ensure compatibility.
|
71
|
+
|
72
|
+
To run the specs with all supported rubocop versions first install the required
|
73
|
+
dependencies with:
|
74
|
+
|
75
|
+
```shell
|
76
|
+
bundle exec appraisals install
|
63
77
|
```
|
64
78
|
|
79
|
+
Then run the specs by just running `rake` it will run specs with all the
|
80
|
+
versions.
|
81
|
+
|
82
|
+
For more info just check the appraisals documentation
|
83
|
+
https://github.com/thoughtbot/appraisal
|
84
|
+
|
65
85
|
## License
|
66
86
|
|
67
|
-
`rubocop-migrations` is MIT
|
68
|
-
the full text.
|
87
|
+
`rubocop-migrations` is MIT
|
88
|
+
licensed. [See the accompanying file](MIT-LICENSE.md) for the full text.
|
data/Rakefile
CHANGED
@@ -1,6 +1,13 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/setup'
|
3
|
+
require 'bundler/gem_tasks'
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
require 'appraisal'
|
3
6
|
|
4
|
-
RSpec::Core::RakeTask.new(:
|
7
|
+
RSpec::Core::RakeTask.new(:test)
|
5
8
|
|
6
|
-
|
9
|
+
if !ENV['APPRAISAL_INITIALIZED'] && !ENV['TRAVIS']
|
10
|
+
task default: :appraisal
|
11
|
+
else
|
12
|
+
task default: :test
|
13
|
+
end
|
data/rubocop-migrations.gemspec
CHANGED
@@ -20,9 +20,10 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
21
|
spec.require_paths = ['lib']
|
22
22
|
|
23
|
-
spec.add_runtime_dependency 'rubocop', '~> 0.41
|
23
|
+
spec.add_runtime_dependency 'rubocop', '~> 0.41'
|
24
24
|
|
25
25
|
spec.add_development_dependency 'bundler', '~> 1.11'
|
26
26
|
spec.add_development_dependency 'rake', '~> 10.0'
|
27
|
-
spec.add_development_dependency 'rspec', '3.5
|
27
|
+
spec.add_development_dependency 'rspec', '~> 3.5'
|
28
|
+
spec.add_development_dependency 'appraisal'
|
28
29
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-migrations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- enricostano
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-10-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rubocop
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.41
|
20
|
+
version: '0.41'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.41
|
27
|
+
version: '0.41'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: bundler
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -57,16 +57,30 @@ dependencies:
|
|
57
57
|
name: rspec
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- -
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '3.5'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '3.5'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: appraisal
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
61
75
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
76
|
+
version: '0'
|
63
77
|
type: :development
|
64
78
|
prerelease: false
|
65
79
|
version_requirements: !ruby/object:Gem::Requirement
|
66
80
|
requirements:
|
67
|
-
- -
|
81
|
+
- - ">="
|
68
82
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
83
|
+
version: '0'
|
70
84
|
description: Performs some checks for migration sanity
|
71
85
|
email:
|
72
86
|
- ocirne.onats@gmail.com
|
@@ -78,12 +92,18 @@ files:
|
|
78
92
|
- ".gitignore"
|
79
93
|
- ".rspec"
|
80
94
|
- ".travis.yml"
|
95
|
+
- Appraisals
|
81
96
|
- Gemfile
|
82
97
|
- LICENSE.txt
|
83
98
|
- README.md
|
84
99
|
- Rakefile
|
85
100
|
- bin/console
|
86
101
|
- bin/setup
|
102
|
+
- gemfiles/.bundle/config
|
103
|
+
- gemfiles/latest_rubocop.gemfile
|
104
|
+
- gemfiles/rubocop_0.41.gemfile
|
105
|
+
- gemfiles/rubocop_0.42.gemfile
|
106
|
+
- gemfiles/rubocop_0.43.gemfile
|
87
107
|
- lib/rubocop/cop/migrations/remove_index.rb
|
88
108
|
- lib/rubocop/migrations.rb
|
89
109
|
- lib/rubocop/migrations/version.rb
|