rubocop-sequel 0.0.6 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/actions.yml +29 -0
- data/.rubocop.yml +1 -1
- data/README.md +4 -2
- data/lib/rubocop/cop/sequel/column_default.rb +1 -0
- data/lib/rubocop/cop/sequel/concurrent_index.rb +2 -3
- data/lib/rubocop/cop/sequel/json_column.rb +3 -0
- data/lib/rubocop/cop/sequel/save_changes.rb +1 -0
- data/rubocop-sequel.gemspec +10 -8
- metadata +16 -46
- data/.travis.yml +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a6bd53027cc6d6df7b1d67153a46c9ac5325509b
|
4
|
+
data.tar.gz: 32b4aa5476643d2c82d4c5495b77ba5cd3fcab02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75952359885f37ceafdc126f9df5b102f3f64d06ed761308085a6fe3498d68382a28bdfef00a6658c14af589f98900a70076fce221d425eb8167b3f2de1d8ed0
|
7
|
+
data.tar.gz: 2016916ef31f9459cc2ad51b4180534563d7c38f901a72e060db218716ddbad3ef9dfc2e35970333bb1877f7ea2d6f6e69018df4c5af37f5ce2de2bd188e5031
|
@@ -0,0 +1,29 @@
|
|
1
|
+
name: CI
|
2
|
+
on: push
|
3
|
+
|
4
|
+
jobs:
|
5
|
+
main:
|
6
|
+
name: Ruby ${{ matrix.ruby }}
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
strategy:
|
9
|
+
matrix:
|
10
|
+
ruby:
|
11
|
+
- 2.4
|
12
|
+
- 2.5
|
13
|
+
- 2.6
|
14
|
+
- 2.7
|
15
|
+
steps:
|
16
|
+
- uses: actions/checkout@v2
|
17
|
+
|
18
|
+
- uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
ruby-version: ${{ matrix.ruby }}
|
21
|
+
|
22
|
+
- name: Install gems
|
23
|
+
run: bundle install
|
24
|
+
|
25
|
+
- name: RuboCop
|
26
|
+
run: bundle exec rubocop --parallel
|
27
|
+
|
28
|
+
- name: RSpec
|
29
|
+
run: bundle exec rspec
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
+
![CI status](https://github.com/rubocop-hq/rubocop-sequel/workflows/CI/badge.svg)
|
2
|
+
|
1
3
|
# RuboCop Sequel
|
2
4
|
|
3
|
-
Code style checking for Sequel.
|
5
|
+
Code style checking for [Sequel](https://sequel.jeremyevans.net/).
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
7
|
-
Using the `rubocop-
|
9
|
+
Using the `rubocop-sequel` gem
|
8
10
|
|
9
11
|
```bash
|
10
12
|
gem install rubocop-sequel
|
@@ -13,9 +13,7 @@ module RuboCop
|
|
13
13
|
|
14
14
|
def on_send(node)
|
15
15
|
indexes?(node) do |args|
|
16
|
-
if offensive?(args)
|
17
|
-
add_offense(node, location: :selector, message: MSG)
|
18
|
-
end
|
16
|
+
add_offense(node, location: :selector, message: MSG) if offensive?(args)
|
19
17
|
end
|
20
18
|
end
|
21
19
|
|
@@ -24,6 +22,7 @@ module RuboCop
|
|
24
22
|
def offensive?(args)
|
25
23
|
!args.last.hash_type? || args.last.each_descendant.none? do |n|
|
26
24
|
next unless n.sym_type?
|
25
|
+
|
27
26
|
n.children.any? { |s| s == :concurrently }
|
28
27
|
end
|
29
28
|
end
|
@@ -21,13 +21,16 @@ module RuboCop
|
|
21
21
|
|
22
22
|
def on_send(node)
|
23
23
|
return unless json_or_hstore?(node)
|
24
|
+
|
24
25
|
add_offense(node, location: :selector, message: MSG)
|
25
26
|
end
|
26
27
|
|
27
28
|
def on_block(node)
|
28
29
|
return unless node.send_node.method_name == :create_table
|
30
|
+
|
29
31
|
node.each_node(:send) do |method|
|
30
32
|
next unless column_method?(method) || column_type?(method)
|
33
|
+
|
31
34
|
add_offense(method, location: :selector, message: MSG)
|
32
35
|
end
|
33
36
|
end
|
data/rubocop-sequel.gemspec
CHANGED
@@ -4,8 +4,8 @@ Gem::Specification.new do |gem|
|
|
4
4
|
gem.authors = ['Timothée Peignier']
|
5
5
|
gem.email = ['timothee.peignier@tryphon.org']
|
6
6
|
gem.description = 'Code style checking for Sequel'
|
7
|
-
gem.summary = 'A plugin for
|
8
|
-
gem.homepage = '
|
7
|
+
gem.summary = 'A Sequel plugin for RuboCop'
|
8
|
+
gem.homepage = 'https://github.com/rubocop-hq/rubocop-sequel'
|
9
9
|
gem.license = 'MIT'
|
10
10
|
|
11
11
|
gem.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
|
@@ -13,14 +13,16 @@ Gem::Specification.new do |gem|
|
|
13
13
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
14
|
gem.name = 'rubocop-sequel'
|
15
15
|
gem.require_paths = ['lib']
|
16
|
-
gem.version = '0.0
|
16
|
+
gem.version = '0.1.0'
|
17
17
|
|
18
|
-
gem.
|
18
|
+
gem.required_ruby_version = '~> 2.4'
|
19
19
|
|
20
|
-
gem.
|
21
|
-
|
22
|
-
gem.add_development_dependency '
|
23
|
-
gem.add_development_dependency '
|
20
|
+
gem.add_runtime_dependency 'rubocop', '~> 1.0'
|
21
|
+
|
22
|
+
gem.add_development_dependency 'rake', '~> 12.3.0'
|
23
|
+
gem.add_development_dependency 'rspec', '~> 3.7'
|
24
|
+
gem.add_development_dependency 'rubocop-rspec', '~> 2.0'
|
25
|
+
gem.add_development_dependency 'sequel', '~> 4.49'
|
24
26
|
gem.add_development_dependency 'simplecov', '~> 0.16'
|
25
27
|
gem.add_development_dependency 'sqlite3', '~> 1.3', '>= 1.3.12'
|
26
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-sequel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Timothée Peignier
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -16,20 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0
|
20
|
-
- - ">="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '0.55'
|
19
|
+
version: '1.0'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
24
|
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: '0
|
30
|
-
- - ">="
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '0.55'
|
26
|
+
version: '1.0'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: rake
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -37,9 +31,6 @@ dependencies:
|
|
37
31
|
- - "~>"
|
38
32
|
- !ruby/object:Gem::Version
|
39
33
|
version: 12.3.0
|
40
|
-
- - ">="
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: 12.0.0
|
43
34
|
type: :development
|
44
35
|
prerelease: false
|
45
36
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -47,9 +38,6 @@ dependencies:
|
|
47
38
|
- - "~>"
|
48
39
|
- !ruby/object:Gem::Version
|
49
40
|
version: 12.3.0
|
50
|
-
- - ">="
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version: 12.0.0
|
53
41
|
- !ruby/object:Gem::Dependency
|
54
42
|
name: rspec
|
55
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -57,9 +45,6 @@ dependencies:
|
|
57
45
|
- - "~>"
|
58
46
|
- !ruby/object:Gem::Version
|
59
47
|
version: '3.7'
|
60
|
-
- - ">="
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: 3.7.0
|
63
48
|
type: :development
|
64
49
|
prerelease: false
|
65
50
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -67,29 +52,20 @@ dependencies:
|
|
67
52
|
- - "~>"
|
68
53
|
- !ruby/object:Gem::Version
|
69
54
|
version: '3.7'
|
70
|
-
- - ">="
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
version: 3.7.0
|
73
55
|
- !ruby/object:Gem::Dependency
|
74
56
|
name: rubocop-rspec
|
75
57
|
requirement: !ruby/object:Gem::Requirement
|
76
58
|
requirements:
|
77
59
|
- - "~>"
|
78
60
|
- !ruby/object:Gem::Version
|
79
|
-
version:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 1.25.0
|
61
|
+
version: '2.0'
|
83
62
|
type: :development
|
84
63
|
prerelease: false
|
85
64
|
version_requirements: !ruby/object:Gem::Requirement
|
86
65
|
requirements:
|
87
66
|
- - "~>"
|
88
67
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
90
|
-
- - ">="
|
91
|
-
- !ruby/object:Gem::Version
|
92
|
-
version: 1.25.0
|
68
|
+
version: '2.0'
|
93
69
|
- !ruby/object:Gem::Dependency
|
94
70
|
name: sequel
|
95
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -97,9 +73,6 @@ dependencies:
|
|
97
73
|
- - "~>"
|
98
74
|
- !ruby/object:Gem::Version
|
99
75
|
version: '4.49'
|
100
|
-
- - ">="
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: 4.49.0
|
103
76
|
type: :development
|
104
77
|
prerelease: false
|
105
78
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -107,9 +80,6 @@ dependencies:
|
|
107
80
|
- - "~>"
|
108
81
|
- !ruby/object:Gem::Version
|
109
82
|
version: '4.49'
|
110
|
-
- - ">="
|
111
|
-
- !ruby/object:Gem::Version
|
112
|
-
version: 4.49.0
|
113
83
|
- !ruby/object:Gem::Dependency
|
114
84
|
name: simplecov
|
115
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -151,10 +121,10 @@ executables: []
|
|
151
121
|
extensions: []
|
152
122
|
extra_rdoc_files: []
|
153
123
|
files:
|
124
|
+
- ".github/workflows/actions.yml"
|
154
125
|
- ".gitignore"
|
155
126
|
- ".rspec"
|
156
127
|
- ".rubocop.yml"
|
157
|
-
- ".travis.yml"
|
158
128
|
- Gemfile
|
159
129
|
- LICENSE
|
160
130
|
- README.md
|
@@ -172,30 +142,30 @@ files:
|
|
172
142
|
- spec/rubocop/cop/sequel/migration_name_spec.rb
|
173
143
|
- spec/rubocop/cop/sequel/save_changes_spec.rb
|
174
144
|
- spec/spec_helper.rb
|
175
|
-
homepage:
|
145
|
+
homepage: https://github.com/rubocop-hq/rubocop-sequel
|
176
146
|
licenses:
|
177
147
|
- MIT
|
178
148
|
metadata: {}
|
179
|
-
post_install_message:
|
149
|
+
post_install_message:
|
180
150
|
rdoc_options: []
|
181
151
|
require_paths:
|
182
152
|
- lib
|
183
153
|
required_ruby_version: !ruby/object:Gem::Requirement
|
184
154
|
requirements:
|
185
|
-
- - "
|
155
|
+
- - "~>"
|
186
156
|
- !ruby/object:Gem::Version
|
187
|
-
version: '
|
157
|
+
version: '2.4'
|
188
158
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
189
159
|
requirements:
|
190
160
|
- - ">="
|
191
161
|
- !ruby/object:Gem::Version
|
192
162
|
version: '0'
|
193
163
|
requirements: []
|
194
|
-
rubyforge_project:
|
195
|
-
rubygems_version: 2.
|
196
|
-
signing_key:
|
164
|
+
rubyforge_project:
|
165
|
+
rubygems_version: 2.6.11
|
166
|
+
signing_key:
|
197
167
|
specification_version: 4
|
198
|
-
summary: A plugin for
|
168
|
+
summary: A Sequel plugin for RuboCop
|
199
169
|
test_files:
|
200
170
|
- spec/rubocop/cop/sequel/column_default_spec.rb
|
201
171
|
- spec/rubocop/cop/sequel/concurrent_index_spec.rb
|