rails_best_practices 1.20.1 → 1.23.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
  SHA256:
3
- metadata.gz: e7a2b67944c27b7a11e48f2c490a4ea1080fc4df39ad1d59b20cdeaedfb4b083
4
- data.tar.gz: d96f6d7da9909bac895162f70ae1247a98a8df39da7fd2ce17365e959568c4f6
3
+ metadata.gz: 6130c27d1f5ad49baeed9bd6595188a99f77e10260f709e7b2dc49bce191d06e
4
+ data.tar.gz: 856313c260d0e66d2625885bdb6f4f1614fa2184303a182d7fb016fb76dac304
5
5
  SHA512:
6
- metadata.gz: 244acdd4067af5f87364236d4fe5bc40d5a4d68b98d1c6786aaf0e53c7766626ef670c4aaa61d793a47bba643fddcd2cbd545a4697dff8d0a3d6f7238912c2b5
7
- data.tar.gz: 9b4ca4c95172317d9017691399fcb9211295bad98959477fa8fa24a054a7a6283dc7cdbabd926e925ccf0f3ea9bfe1dde3e594cc42a2db7bd3b37758cb7bdc6e
6
+ metadata.gz: 66c463631584235d020ea1ee12d748119827de1c9347660ccf5fde82191038ab75cd07f9266933c199a2fd6c722abf566eb75ec906f1c717a557c4e19e327278
7
+ data.tar.gz: 453991a40ccdf9f0549dbe6842e8823034a41e5b253efdccde0e4442a0ea17b654046747dea4de54ac4312eae89bd4ec946c45ded98c356d7f12465294b34d8d
@@ -0,0 +1,31 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: CI
9
+
10
+ on:
11
+ push:
12
+ branches: [ master ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ jobs:
17
+ test:
18
+ runs-on: ubuntu-latest
19
+ strategy:
20
+ matrix:
21
+ ruby-version: ['2.6', '2.7', '3.0', '3.1']
22
+
23
+ steps:
24
+ - uses: actions/checkout@v2
25
+ - name: Set up Ruby
26
+ uses: ruby/setup-ruby@v1
27
+ with:
28
+ ruby-version: ${{ matrix.ruby-version }}
29
+ bundler-cache: true
30
+ - name: Run tests
31
+ run: bundle exec rspec spec
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.1.0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Next Release
2
2
 
3
+ ## 1.23.0 (2022-01-31)
4
+
5
+ * Support hash short syntax
6
+
7
+ ## 1.22.0 (2021-10-27)
8
+
9
+ * Support atom editor
10
+
11
+ ## 1.21.0 (2021-06-15)
12
+
13
+ * Disable check by inline comment
14
+ * Add type check for string
15
+
3
16
  ## 1.20.0 (2020-02-29)
4
17
 
5
18
  * Support ruby 2.7
data/Gemfile CHANGED
@@ -8,4 +8,3 @@ gem 'coveralls', require: false
8
8
  gem 'guard'
9
9
  gem 'guard-rspec'
10
10
  gem 'pry'
11
- gem 'rspec'
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails_best_practices (1.20.1)
5
- activesupport
6
- code_analyzer (>= 0.5.2)
4
+ rails_best_practices (1.23.0)
5
+ activesupport (~> 6.1.4)
6
+ code_analyzer (~> 0.5.5)
7
7
  erubis
8
8
  i18n
9
9
  json
@@ -13,79 +13,81 @@ PATH
13
13
  GEM
14
14
  remote: https://rubygems.org/
15
15
  specs:
16
- activesupport (6.1.3.2)
16
+ activesupport (6.1.4.4)
17
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
18
  i18n (>= 1.6, < 2)
19
19
  minitest (>= 5.1)
20
20
  tzinfo (~> 2.0)
21
21
  zeitwerk (~> 2.3)
22
22
  awesome_print (1.8.0)
23
- code_analyzer (0.5.2)
23
+ code_analyzer (0.5.5)
24
24
  sexp_processor
25
- coderay (1.1.2)
26
- concurrent-ruby (1.1.8)
25
+ coderay (1.1.3)
26
+ concurrent-ruby (1.1.9)
27
27
  coveralls (0.8.23)
28
28
  json (>= 1.8, < 3)
29
29
  simplecov (~> 0.16.1)
30
30
  term-ansicolor (~> 1.3)
31
31
  thor (>= 0.19.4, < 2.0)
32
32
  tins (~> 1.6)
33
- diff-lcs (1.3)
33
+ diff-lcs (1.4.4)
34
34
  docile (1.3.2)
35
35
  erubis (2.7.0)
36
- ffi (1.11.3)
37
- formatador (0.2.5)
38
- guard (2.16.1)
36
+ ffi (1.15.4)
37
+ formatador (0.3.0)
38
+ guard (2.18.0)
39
39
  formatador (>= 0.2.4)
40
40
  listen (>= 2.7, < 4.0)
41
41
  lumberjack (>= 1.0.12, < 2.0)
42
42
  nenv (~> 0.1)
43
43
  notiffany (~> 0.0)
44
- pry (>= 0.9.12)
44
+ pry (>= 0.13.0)
45
45
  shellany (~> 0.0)
46
46
  thor (>= 0.18.1)
47
- guard-rspec (4.3.1)
47
+ guard-compat (1.2.1)
48
+ guard-rspec (4.7.3)
48
49
  guard (~> 2.1)
49
- rspec (>= 2.14, < 4.0)
50
+ guard-compat (~> 1.1)
51
+ rspec (>= 2.99.0, < 4.0)
50
52
  haml (5.1.2)
51
53
  temple (>= 0.8.0)
52
54
  tilt
53
- i18n (1.8.10)
55
+ i18n (1.9.1)
54
56
  concurrent-ruby (~> 1.0)
55
57
  json (2.3.0)
56
- listen (3.2.1)
58
+ listen (3.7.0)
57
59
  rb-fsevent (~> 0.10, >= 0.10.3)
58
60
  rb-inotify (~> 0.9, >= 0.9.10)
59
- lumberjack (1.0.13)
60
- method_source (0.9.2)
61
- minitest (5.14.4)
61
+ lumberjack (1.2.8)
62
+ method_source (1.0.0)
63
+ minitest (5.15.0)
62
64
  nenv (0.3.0)
63
65
  notiffany (0.1.3)
64
66
  nenv (~> 0.1)
65
67
  shellany (~> 0.0)
66
- pry (0.12.2)
67
- coderay (~> 1.1.0)
68
- method_source (~> 0.9.0)
68
+ pry (0.14.1)
69
+ coderay (~> 1.1)
70
+ method_source (~> 1.0)
69
71
  rake (13.0.1)
70
- rb-fsevent (0.10.3)
72
+ rb-fsevent (0.11.0)
71
73
  rb-inotify (0.10.1)
72
74
  ffi (~> 1.0)
73
75
  require_all (3.0.0)
74
- rspec (3.9.0)
75
- rspec-core (~> 3.9.0)
76
- rspec-expectations (~> 3.9.0)
77
- rspec-mocks (~> 3.9.0)
78
- rspec-core (3.9.1)
79
- rspec-support (~> 3.9.1)
80
- rspec-expectations (3.9.1)
76
+ rspec (3.10.0)
77
+ rspec-core (~> 3.10.0)
78
+ rspec-expectations (~> 3.10.0)
79
+ rspec-mocks (~> 3.10.0)
80
+ rspec-core (3.10.1)
81
+ rspec-support (~> 3.10.0)
82
+ rspec-expectations (3.10.1)
81
83
  diff-lcs (>= 1.2.0, < 2.0)
82
- rspec-support (~> 3.9.0)
83
- rspec-mocks (3.9.1)
84
+ rspec-support (~> 3.10.0)
85
+ rspec-mocks (3.10.2)
84
86
  diff-lcs (>= 1.2.0, < 2.0)
85
- rspec-support (~> 3.9.0)
86
- rspec-support (3.9.2)
87
+ rspec-support (~> 3.10.0)
88
+ rspec-support (3.10.2)
87
89
  ruby-progressbar (1.11.0)
88
- sexp_processor (4.15.2)
90
+ sexp_processor (4.16.0)
89
91
  shellany (0.0.1)
90
92
  simplecov (0.16.1)
91
93
  docile (~> 1.1)
@@ -98,12 +100,12 @@ GEM
98
100
  temple (0.8.2)
99
101
  term-ansicolor (1.7.1)
100
102
  tins (~> 1.0)
101
- thor (1.0.1)
103
+ thor (1.1.0)
102
104
  tilt (2.0.10)
103
105
  tins (1.22.2)
104
106
  tzinfo (2.0.4)
105
107
  concurrent-ruby (~> 1.0)
106
- zeitwerk (2.4.2)
108
+ zeitwerk (2.5.4)
107
109
 
108
110
  PLATFORMS
109
111
  ruby
@@ -122,4 +124,4 @@ DEPENDENCIES
122
124
  slim
123
125
 
124
126
  BUNDLED WITH
125
- 2.1.4
127
+ 2.2.22
data/README.md CHANGED
@@ -284,7 +284,7 @@ Follow us on twitter: <http://twitter.com/railsbp>
284
284
  Send us email: <team@railsbp.com>
285
285
 
286
286
 
287
- Copyright © 2009 - 2013 Richard Huang (flyerhzm@gmail.com), released under the MIT license
287
+ Copyright © 2009 - 2022 Richard Huang (flyerhzm@gmail.com), released under the MIT license
288
288
 
289
289
 
290
290
  [1]: https://github.com/railsbp/rails_best_practices/wiki/How-to-write-your-own-check-list
@@ -115,6 +115,8 @@
115
115
  <td class='filename'>
116
116
  <% if @github %>
117
117
  <a href='<%= @github_name %>/blob/<%= @last_commit_id %>/<%= error.short_filename %>#L<%= error.first_line_number %>' target='_blank'><%= error.short_filename %></a>
118
+ <% elsif @atom %>
119
+ <a href='atom://core/open/file?filename=<%= File.expand_path(error.filename) %>&amp;line=<%= error.line_number %>'><%= error.short_filename %></a>
118
120
  <% elsif @textmate %>
119
121
  <a href='txmt://open/?url=file://<%= File.expand_path(error.filename) %>&amp;line=<%= error.line_number %>'><%= error.short_filename %></a>
120
122
  <% elsif @sublime %>
@@ -249,6 +249,7 @@ module RailsBestPractices
249
249
  file.puts eruby.evaluate(
250
250
  errors: errors,
251
251
  error_types: error_types,
252
+ atom: @options['with-atom'],
252
253
  textmate: @options['with-textmate'],
253
254
  vscode: @options['with-vscode'],
254
255
  sublime: @options['with-sublime'],
@@ -326,8 +327,8 @@ module RailsBestPractices
326
327
 
327
328
  # analyze source codes.
328
329
  def analyze_source_codes
329
- @bar = ProgressBar.create(title: 'Source Code', total: parse_files.size * 3) if display_bar?
330
- %w[lexical prepare review].each { |process| send(:process, process) }
330
+ @bar = ProgressBar.create(title: 'Source Code', total: parse_files.size * 4) if display_bar?
331
+ %w[lexical prepare review inline_disable].each { |process| send(:process, process) }
331
332
  @bar.finish if display_bar?
332
333
  end
333
334
 
@@ -204,7 +204,7 @@ module RailsBestPractices
204
204
  :command_call,
205
205
  :command,
206
206
  :alias,
207
- :bare_assoc_hash,
207
+ :assoc_new,
208
208
  :method_add_arg
209
209
 
210
210
  # remembe the message of call node.
@@ -269,9 +269,12 @@ module RailsBestPractices
269
269
  # def to_xml(options = {})
270
270
  # super options.merge(exclude: :visible, methods: [:is_discussion_conversation])
271
271
  # end
272
- add_callback :start_bare_assoc_hash do |node|
273
- if node.hash_keys.include? 'methods'
274
- mark_used(node.hash_value('methods'))
272
+ add_callback :start_assoc_new do |node|
273
+ if node.key == 'methods'
274
+ mark_used(node.value)
275
+ end
276
+ if node.value.nil?
277
+ mark_used(node.key)
275
278
  end
276
279
  end
277
280
 
@@ -294,7 +297,9 @@ module RailsBestPractices
294
297
  def mark_used(method_node)
295
298
  return if method_node == :call
296
299
 
297
- if method_node.sexp_type == :bare_assoc_hash
300
+ if method_node.is_a?(String)
301
+ method_name = method_node
302
+ elsif method_node.sexp_type == :bare_assoc_hash
298
303
  method_node.hash_values.each { |value_node| mark_used(value_node) }
299
304
  elsif method_node.sexp_type == :array
300
305
  method_node.array_values.each { |value_node| mark_used(value_node) }
@@ -65,6 +65,9 @@ module RailsBestPractices
65
65
  checkers: @prepares.reject { |checker| checker.is_a? Prepares::GemfilePrepare }
66
66
  )
67
67
  @review_checker ||= CodeAnalyzer::CheckingVisitor::Default.new(checkers: @reviews)
68
+
69
+ @inlnie_disable ||= InlineDisables::InlineDisable.new
70
+ @inline_disable_checker ||= CodeAnalyzer::CheckingVisitor::Plain.new(checkers: [@inlnie_disable])
68
71
  end
69
72
 
70
73
  # lexical analysis the file.
@@ -106,11 +109,27 @@ module RailsBestPractices
106
109
  @review_checker.after_check
107
110
  end
108
111
 
112
+ # disable check by inline comment the file.
113
+ #
114
+ # @param [String] filename of the file
115
+ # @param [String] content of the file
116
+ def inline_disable(filename, content)
117
+ content = parse_html_template(filename, content)
118
+ @inline_disable_checker.check(filename, content)
119
+ end
120
+
121
+ def after_inline_disable
122
+ @inline_disable_checker.after_check
123
+ end
124
+
109
125
  # get all errors from lexicals and reviews.
110
126
  #
111
127
  # @return [Array] all errors from lexicals and reviews
112
128
  def errors
113
- @errors ||= (@reviews + @lexicals).collect(&:errors).flatten
129
+ @errors ||= begin
130
+ reported_errors = (@reviews + @lexicals).collect(&:errors).flatten
131
+ reported_errors.reject { |error| @inlnie_disable.disabled?(error) }
132
+ end
114
133
  end
115
134
 
116
135
  private
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RailsBestPractices
4
+ module InlineDisables
5
+ class CommentRipper < Ripper::SexpBuilder
6
+ attr_reader :comments
7
+
8
+ def initialize(*arg)
9
+ super
10
+ @comments = []
11
+ end
12
+
13
+ def on_comment(*arg)
14
+ # [sexp_type, statement, [lineno, column]] = super
15
+ comments << super
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RailsBestPractices
4
+ module InlineDisables
5
+ class InlineDisable < Core::Check
6
+ interesting_files ALL_FILES
7
+ url '#'
8
+
9
+ def initialize(*args)
10
+ super
11
+ @disabled_errors = []
12
+ end
13
+
14
+ def check(filename, content)
15
+ comments = CommentRipper.new(content).tap(&:parse).comments
16
+ comments.each do |_sexp_type, statement, (line_number, _column)|
17
+ add_as_disable_errors(filename, statement, line_number)
18
+ end
19
+ end
20
+
21
+ def disabled?(error)
22
+ error_key = [error.filename, error.line_number, error.type.split('::').last].join('-')
23
+ disabled_error_keys.include?(error_key)
24
+ end
25
+
26
+ private
27
+
28
+ def disabled_error_keys
29
+ @disabled_error_keys ||= Set.new(@disabled_errors.map { |e| [e.filename, e.line_number, e.type].join('-') })
30
+ end
31
+
32
+ def add_as_disable_errors(filename, statement, line_number)
33
+ match = statement.match(/rails_b(?:est_)?p(?:ractices)?:disable (.*)/)
34
+ return unless match
35
+
36
+ check_names = match[1].split(',')
37
+ check_names.each do |check_name|
38
+ add_as_disable_error(filename, check_name.gsub(/Check$/, 'Review'), line_number)
39
+ end
40
+ end
41
+
42
+ def add_as_disable_error(filename, check_name, line_number)
43
+ @disabled_errors <<
44
+ RailsBestPractices::Core::Error.new(
45
+ filename: filename, line_number: line_number, message: 'disable by inline comment', type: check_name, url: url
46
+ )
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_rel 'inline_disables'
@@ -10,6 +10,7 @@ module RailsBestPractices
10
10
  # -f, --format FORMAT output format (text, html, yaml, json, xml)
11
11
  # --output-file FILE output html file for the analyzing result
12
12
  # --without-color only output plain text without color
13
+ # --with-atom open file by atom in html format
13
14
  # --with-textmate open file by textmate in html format
14
15
  # --with-vscode open file by vscode in html format
15
16
  # --with-sublime open file by sublime in html format (requires subl-handler)
@@ -49,6 +50,10 @@ module RailsBestPractices
49
50
  options['without-color'] = true
50
51
  end
51
52
 
53
+ opts.on('--with-atom', 'open file by atom in html format') do
54
+ options['with-atom'] = true
55
+ end
56
+
52
57
  opts.on('--with-textmate', 'open file by textmate in html format') do
53
58
  options['with-textmate'] = true
54
59
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsBestPractices
4
- VERSION = '1.20.1'
4
+ VERSION = '1.23.0'
5
5
  end
@@ -8,6 +8,7 @@ require 'rails_best_practices/analyzer'
8
8
  require 'rails_best_practices/lexicals'
9
9
  require 'rails_best_practices/prepares'
10
10
  require 'rails_best_practices/reviews'
11
+ require 'rails_best_practices/inline_disables'
11
12
  require 'rails_best_practices/option_parser'
12
13
  require 'rails_best_practices/cli'
13
14
 
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require File.expand_path('lib/rails_best_practices/version', __dir__)
3
+ lib = File.expand_path('lib', __dir__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'rails_best_practices/version'
4
6
 
5
7
  Gem::Specification.new do |spec|
6
8
  spec.name = 'rails_best_practices'
@@ -16,13 +18,13 @@ Gem::Specification.new do |spec|
16
18
  spec.required_ruby_version = '>= 1.9.0'
17
19
  spec.required_rubygems_version = '>= 1.3.6'
18
20
 
19
- spec.add_dependency('activesupport')
20
- spec.add_dependency('code_analyzer', '>= 0.5.2')
21
- spec.add_dependency('erubis')
22
- spec.add_dependency('i18n')
23
- spec.add_dependency('json')
24
- spec.add_dependency('require_all', '~> 3.0')
25
- spec.add_dependency('ruby-progressbar')
21
+ spec.add_runtime_dependency('activesupport', '~> 6.1.4')
22
+ spec.add_runtime_dependency('code_analyzer', '~> 0.5.5')
23
+ spec.add_runtime_dependency('erubis')
24
+ spec.add_runtime_dependency('i18n')
25
+ spec.add_runtime_dependency('json')
26
+ spec.add_runtime_dependency('require_all', '~> 3.0')
27
+ spec.add_runtime_dependency('ruby-progressbar')
26
28
 
27
29
  spec.add_development_dependency('awesome_print')
28
30
  spec.add_development_dependency('bundler')
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ module RailsBestPractices
6
+ module InlineDisables
7
+ describe InlineDisable do
8
+ let(:runner) { Core::Runner.new(reviews: Reviews::MoveModelLogicIntoModelReview.new) }
9
+
10
+ it 'moves model logic into model' do
11
+ content = <<-EOF
12
+ class PostsController < ApplicationController
13
+ def publish
14
+ @post = Post.find(params[:id])
15
+ @post.update_attributes(:is_published, true)
16
+ @post.approved_by = current_user
17
+
18
+ if @post.created_at > Time.now - 7.days
19
+ @post.popular = 100
20
+ else
21
+ @post.popular = 0
22
+ end
23
+
24
+ redirect_to post_url(@post)
25
+ end
26
+ end
27
+ EOF
28
+ runner.review('app/controllers/posts_controller.rb', content)
29
+ runner.inline_disable('app/controllers/posts_controller.rb', content)
30
+
31
+ expect(runner.errors.size).to eq(1)
32
+ expect(runner.errors[0].to_s).to eq(
33
+ 'app/controllers/posts_controller.rb:2 - move model logic into model (@post use_count > 4)'
34
+ )
35
+ end
36
+
37
+ it 'is no error is output' do
38
+ content = <<-EOF
39
+ class PostsController < ApplicationController
40
+ def publish # rails_best_practices:disable MoveModelLogicIntoModelCheck
41
+ @post = Post.find(params[:id])
42
+ @post.update_attributes(:is_published, true)
43
+ @post.approved_by = current_user
44
+
45
+ if @post.created_at > Time.now - 7.days
46
+ @post.popular = 100
47
+ else
48
+ @post.popular = 0
49
+ end
50
+
51
+ redirect_to post_url(@post)
52
+ end
53
+ end
54
+ EOF
55
+ runner.review('app/controllers/posts_controller.rb', content)
56
+ runner.inline_disable('app/controllers/posts_controller.rb', content)
57
+
58
+ expect(runner.errors.size).to eq(0)
59
+ end
60
+ end
61
+ end
62
+ end
@@ -556,6 +556,28 @@ module RailsBestPractices
556
556
  end
557
557
  end
558
558
 
559
+ if RUBY_VERSION.to_f > 3.0
560
+ context 'short syntax value' do
561
+ it 'does not remove unused method' do
562
+ content = <<-EOF
563
+ class Post < ActiveRecord::Base
564
+ def build
565
+ new(value:)
566
+ end
567
+
568
+ def value
569
+ 'value'
570
+ end
571
+ end
572
+ EOF
573
+ runner.prepare('app/models/post.rb', content)
574
+ runner.review('app/models/post.rb', content)
575
+ runner.after_review
576
+ expect(runner.errors.size).to eq(1)
577
+ end
578
+ end
579
+ end
580
+
559
581
  context 'callbacks' do
560
582
  it 'does not remove unused method' do
561
583
  content = <<-EOF
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_best_practices
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.20.1
4
+ version: 1.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-08 00:00:00.000000000 Z
11
+ date: 2022-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 6.1.4
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'
26
+ version: 6.1.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: code_analyzer
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.5.2
33
+ version: 0.5.5
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.5.2
40
+ version: 0.5.5
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: erubis
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -200,9 +200,10 @@ executables:
200
200
  extensions: []
201
201
  extra_rdoc_files: []
202
202
  files:
203
+ - ".github/workflows/main.yml"
203
204
  - ".gitignore"
204
205
  - ".rspec"
205
- - ".travis.yml"
206
+ - ".ruby-version"
206
207
  - CHANGELOG.md
207
208
  - Gemfile
208
209
  - Gemfile.lock
@@ -235,6 +236,9 @@ files:
235
236
  - lib/rails_best_practices/core/routes.rb
236
237
  - lib/rails_best_practices/core/runner.rb
237
238
  - lib/rails_best_practices/core_ext/erubis.rb
239
+ - lib/rails_best_practices/inline_disables.rb
240
+ - lib/rails_best_practices/inline_disables/comment_ripper.rb
241
+ - lib/rails_best_practices/inline_disables/inline_disable.rb
238
242
  - lib/rails_best_practices/lexicals.rb
239
243
  - lib/rails_best_practices/lexicals/long_line_check.rb
240
244
  - lib/rails_best_practices/lexicals/remove_tab_check.rb
@@ -314,6 +318,7 @@ files:
314
318
  - spec/rails_best_practices/core/routes_spec.rb
315
319
  - spec/rails_best_practices/core/runner_spec.rb
316
320
  - spec/rails_best_practices/core_ext/erubis_spec.rb
321
+ - spec/rails_best_practices/inline_disables/inline_disable_spec.rb
317
322
  - spec/rails_best_practices/lexicals/long_line_check_spec.rb
318
323
  - spec/rails_best_practices/lexicals/remove_tab_check_spec.rb
319
324
  - spec/rails_best_practices/lexicals/remove_trailing_whitespace_check_spec.rb
@@ -399,7 +404,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
399
404
  - !ruby/object:Gem::Version
400
405
  version: 1.3.6
401
406
  requirements: []
402
- rubygems_version: 3.1.6
407
+ rubygems_version: 3.3.3
403
408
  signing_key:
404
409
  specification_version: 4
405
410
  summary: a code metric tool for rails codes.
@@ -424,6 +429,7 @@ test_files:
424
429
  - spec/rails_best_practices/core/routes_spec.rb
425
430
  - spec/rails_best_practices/core/runner_spec.rb
426
431
  - spec/rails_best_practices/core_ext/erubis_spec.rb
432
+ - spec/rails_best_practices/inline_disables/inline_disable_spec.rb
427
433
  - spec/rails_best_practices/lexicals/long_line_check_spec.rb
428
434
  - spec/rails_best_practices/lexicals/remove_tab_check_spec.rb
429
435
  - spec/rails_best_practices/lexicals/remove_trailing_whitespace_check_spec.rb
data/.travis.yml DELETED
@@ -1,4 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.6.4
4
- script: bundle exec rspec spec