rubocop-minitest 0.21.1 → 0.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/config/default.yml +5 -0
  3. data/lib/rubocop/cop/minitest/assert_match.rb +1 -1
  4. data/lib/rubocop/cop/minitest/assert_raises_with_regexp_argument.rb +36 -0
  5. data/lib/rubocop/cop/minitest_cops.rb +1 -0
  6. data/lib/rubocop/cop/mixin/argument_range_helper.rb +1 -0
  7. data/lib/rubocop/cop/mixin/in_delta_mixin.rb +1 -0
  8. data/lib/rubocop/cop/mixin/minitest_cop_rule.rb +13 -5
  9. data/lib/rubocop/cop/mixin/minitest_exploration_helpers.rb +1 -0
  10. data/lib/rubocop/cop/mixin/nil_assertion_handleable.rb +1 -0
  11. data/lib/rubocop/cop/mixin/predicate_assertion_handleable.rb +1 -0
  12. data/lib/rubocop/minitest/version.rb +1 -1
  13. metadata +4 -81
  14. data/.circleci/config.yml +0 -55
  15. data/.gitattributes +0 -1
  16. data/.github/FUNDING.yml +0 -7
  17. data/.github/ISSUE_TEMPLATE/bug_report.md +0 -43
  18. data/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  19. data/.github/PULL_REQUEST_TEMPLATE.md +0 -17
  20. data/.github/workflows/linting.yml +0 -15
  21. data/.github/workflows/spell_checking.yml +0 -33
  22. data/.gitignore +0 -61
  23. data/.rubocop.yml +0 -110
  24. data/.rubocop_todo.yml +0 -19
  25. data/.yamllint.yml +0 -9
  26. data/.yardopts +0 -3
  27. data/CHANGELOG.md +0 -336
  28. data/CONTRIBUTING.md +0 -69
  29. data/Gemfile +0 -16
  30. data/Rakefile +0 -56
  31. data/bin/console +0 -11
  32. data/bin/setup +0 -8
  33. data/codespell.txt +0 -0
  34. data/docs/antora.yml +0 -7
  35. data/docs/modules/ROOT/nav.adoc +0 -6
  36. data/docs/modules/ROOT/pages/cops.adoc +0 -56
  37. data/docs/modules/ROOT/pages/cops_minitest.adoc +0 -1450
  38. data/docs/modules/ROOT/pages/index.adoc +0 -5
  39. data/docs/modules/ROOT/pages/installation.adoc +0 -15
  40. data/docs/modules/ROOT/pages/usage.adoc +0 -32
  41. data/legacy-docs/cops.md +0 -23
  42. data/legacy-docs/cops_minitest.md +0 -448
  43. data/legacy-docs/index.md +0 -1
  44. data/legacy-docs/installation.md +0 -11
  45. data/legacy-docs/usage.md +0 -27
  46. data/mkdocs.yml +0 -13
  47. data/readthedocs.yml +0 -5
  48. data/relnotes/v0.1.0.md +0 -7
  49. data/relnotes/v0.10.0.md +0 -21
  50. data/relnotes/v0.10.1.md +0 -5
  51. data/relnotes/v0.10.2.md +0 -5
  52. data/relnotes/v0.10.3.md +0 -5
  53. data/relnotes/v0.11.0.md +0 -16
  54. data/relnotes/v0.11.1.md +0 -5
  55. data/relnotes/v0.12.0.md +0 -10
  56. data/relnotes/v0.12.1.md +0 -5
  57. data/relnotes/v0.13.0.md +0 -5
  58. data/relnotes/v0.14.0.md +0 -5
  59. data/relnotes/v0.15.0.md +0 -5
  60. data/relnotes/v0.15.1.md +0 -5
  61. data/relnotes/v0.15.2.md +0 -5
  62. data/relnotes/v0.16.0.md +0 -11
  63. data/relnotes/v0.17.0.md +0 -5
  64. data/relnotes/v0.17.1.md +0 -5
  65. data/relnotes/v0.17.2.md +0 -5
  66. data/relnotes/v0.18.0.md +0 -9
  67. data/relnotes/v0.19.0.md +0 -5
  68. data/relnotes/v0.19.1.md +0 -5
  69. data/relnotes/v0.2.0.md +0 -9
  70. data/relnotes/v0.2.1.md +0 -5
  71. data/relnotes/v0.20.0.md +0 -13
  72. data/relnotes/v0.20.1.md +0 -5
  73. data/relnotes/v0.21.0.md +0 -5
  74. data/relnotes/v0.21.1.md +0 -5
  75. data/relnotes/v0.3.0.md +0 -16
  76. data/relnotes/v0.4.0.md +0 -14
  77. data/relnotes/v0.4.1.md +0 -5
  78. data/relnotes/v0.5.0.md +0 -5
  79. data/relnotes/v0.5.1.md +0 -5
  80. data/relnotes/v0.6.0.md +0 -5
  81. data/relnotes/v0.6.1.md +0 -6
  82. data/relnotes/v0.6.2.md +0 -5
  83. data/relnotes/v0.7.0.md +0 -13
  84. data/relnotes/v0.8.0.md +0 -12
  85. data/relnotes/v0.8.1.md +0 -5
  86. data/relnotes/v0.9.0.md +0 -10
  87. data/rubocop-minitest.gemspec +0 -40
  88. data/tasks/changelog.rake +0 -34
  89. data/tasks/changelog.rb +0 -166
  90. data/tasks/cops_documentation.rake +0 -50
  91. data/tasks/cut_release.rake +0 -86
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 32fe1532cdbac42cfc34dd6be3ce6c06af43c58b0fdac50d4d0afafb92006db8
4
- data.tar.gz: bfdd3899218529e728b777b77092103c1bf9db73523835666988d953a6b47f3d
3
+ metadata.gz: 6db30fddaa89f75fb61790465161c9de6e0fd0c7d3808afa9d091e9eac97a30e
4
+ data.tar.gz: fbf5dac86cbf247ded62e437f5cb79e8c1dece32b7ec78eeda0b3c8c20fdd7d7
5
5
  SHA512:
6
- metadata.gz: a6c4de4a42725e76f84de44313534b07a958f7c84ac5a63b8c7948b1edb9eadc27e81734721f7adda6b6b0b2d4a9e9ee8a90f9fa401fde7bd2faf799b229dded
7
- data.tar.gz: 01d06e6462b2fc9f4dbdc133392d4b266a2df33ebac5ebbe042dd6d3185062bfd4df1017b4a3e255e12b56152284f2d2484668e650262907c9de3a3bccaee299
6
+ metadata.gz: b5c7535584d692c5a2e4c62ddcfdd89939594b6c51082ba2d497f81b36b8a0b7153940c2846a14dfea681f5fe51753324e90e4d7488fb477a96e99b7aa8f2a77
7
+ data.tar.gz: 5e53402c171a4dabe59f71a8d102cfd5e8dd963c47d082f305803c749f258bcf1c114e552cbc8fde60a0486002348520c6dd46fa06d3476a80b5b967835e2013
data/config/default.yml CHANGED
@@ -82,6 +82,11 @@ Minitest/AssertRaisesCompoundBody:
82
82
  Enabled: pending
83
83
  VersionAdded: '0.21'
84
84
 
85
+ Minitest/AssertRaisesWithRegexpArgument:
86
+ Description: 'This cop enforces checks for regular expression literals passed to `assert_raises`.'
87
+ Enabled: pending
88
+ VersionAdded: '0.22'
89
+
85
90
  Minitest/AssertRespondTo:
86
91
  Description: 'This cop enforces the test to use `assert_respond_to(object, :do_something)` over `assert(object.respond_to?(:do_something))`.'
87
92
  StyleGuide: 'https://minitest.rubystyle.guide#assert-responds-to-method'
@@ -18,7 +18,7 @@ module RuboCop
18
18
  class AssertMatch < Base
19
19
  extend MinitestCopRule
20
20
 
21
- define_rule :assert, target_method: :match
21
+ define_rule :assert, target_method: :match, inverse: 'regexp_type?'
22
22
  end
23
23
  end
24
24
  end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module Cop
5
+ module Minitest
6
+ # Checks for `assert_raises` with arguments of regular expression literals.
7
+ # Arguments should be exception classes.
8
+ # Optionally the last argument can be a custom message string to help explain failures.
9
+ # Either way, it's not the argument that `exception.message` is compared to.
10
+ # The raised exception is returned and can be used
11
+ # to match against a regular expression.
12
+ #
13
+ # @example
14
+ #
15
+ # # bad
16
+ # assert_raises FooError, /some message/ do
17
+ # obj.occur_error
18
+ # end
19
+ #
20
+ # # good
21
+ # exception = assert_raises FooError do
22
+ # obj.occur_error
23
+ # end
24
+ # assert_match(/some message/, exception.message)
25
+ #
26
+ class AssertRaisesWithRegexpArgument < Base
27
+ MSG = 'Do not pass regular expression literals to `assert_raises`. Test the resulting exception.'
28
+ RESTRICT_ON_SEND = %i[assert_raises].freeze
29
+
30
+ def on_send(node)
31
+ add_offense(node) if node.last_argument&.regexp_type?
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -12,6 +12,7 @@ require_relative 'minitest/assert_equal'
12
12
  require_relative 'minitest/assert_in_delta'
13
13
  require_relative 'minitest/assert_predicate'
14
14
  require_relative 'minitest/assert_raises_compound_body'
15
+ require_relative 'minitest/assert_raises_with_regexp_argument'
15
16
  require_relative 'minitest/assert_with_expected_argument'
16
17
  require_relative 'minitest/assertion_in_lifecycle_hook'
17
18
  require_relative 'minitest/assert_kind_of'
@@ -3,6 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  # Methods that calculate and return `Parser::Source::Ranges`.
6
+ # @api private
6
7
  module ArgumentRangeHelper
7
8
  include RangeHelp
8
9
 
@@ -3,6 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  # Common functionality for `AssertInDelta` and `RefuteInDelta` cops.
6
+ # @api private
6
7
  module InDeltaMixin
7
8
  MSG = 'Prefer using `%<good_method>s`.'
8
9
 
@@ -19,7 +19,9 @@ module RuboCop
19
19
  # autocorrection. The preferred method name that connects
20
20
  # `assertion_method` and `target_method` with `_` is
21
21
  # the default name.
22
- # @param inverse [Boolean] An optional param. Order of arguments replaced by autocorrection.
22
+ # @param inverse [Boolean, String] An optional param. Order of arguments replaced by autocorrection.
23
+ # If string is passed, it becomes a predicate method for the first argument node.
24
+ # @api private
23
25
  #
24
26
  def define_rule(assertion_method, target_method:, preferred_method: nil, inverse: false)
25
27
  preferred_method = "#{assertion_method}_#{target_method.to_s.delete('?')}" if preferred_method.nil?
@@ -34,7 +36,8 @@ module RuboCop
34
36
  def on_send(node)
35
37
  return unless node.method?(:#{assertion_method})
36
38
  return unless (arguments = peel_redundant_parentheses_from(node.arguments))
37
- return unless arguments.first.respond_to?(:method?) && arguments.first.method?(:#{target_method})
39
+ return unless arguments.first&.call_type?
40
+ return if arguments.first.arguments.empty? || !arguments.first.method?(:#{target_method})
38
41
 
39
42
  add_offense(node, message: offense_message(arguments)) do |corrector|
40
43
  autocorrect(corrector, node, arguments)
@@ -77,10 +80,15 @@ module RuboCop
77
80
 
78
81
  def new_arguments(arguments)
79
82
  receiver = correct_receiver(arguments.first.receiver)
80
- method_argument = arguments.first.arguments.first&.source
83
+ method_argument = arguments.first.arguments.first
81
84
 
82
- new_arguments = [receiver, method_argument].compact
83
- new_arguments.reverse! if #{inverse}
85
+ new_arguments = [receiver, method_argument&.source].compact
86
+ inverse_condition = if %w[true false].include?('#{inverse}')
87
+ #{inverse}
88
+ else
89
+ method_argument.#{inverse}
90
+ end
91
+ new_arguments.reverse! if inverse_condition
84
92
  new_arguments
85
93
  end
86
94
 
@@ -5,6 +5,7 @@ require 'set'
5
5
  module RuboCop
6
6
  module Cop
7
7
  # Helper methods for different explorations against test files and test cases.
8
+ # @api private
8
9
  module MinitestExplorationHelpers
9
10
  extend NodePattern::Macros
10
11
 
@@ -4,6 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Minitest
6
6
  # Common functionality for `AssertNil` and `RefuteNil` cops.
7
+ # @api private
7
8
  module NilAssertionHandleable
8
9
  MSG = 'Prefer using `%<assertion_type>s_nil(%<preferred_args>s)`.'
9
10
 
@@ -4,6 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Minitest
6
6
  # Common functionality for `Minitest/AssertPredicate` and `Minitest/RefutePredicate` cops.
7
+ # @api private
7
8
  module PredicateAssertionHandleable
8
9
  MSG = 'Prefer using `%<assertion_type>s_predicate(%<new_arguments>s)`.'
9
10
 
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Minitest
5
5
  # This module holds the RuboCop Minitest version information.
6
6
  module Version
7
- STRING = '0.21.1'
7
+ STRING = '0.22.1'
8
8
 
9
9
  def self.document_version
10
10
  STRING.match('\d+\.\d+').to_s
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-minitest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.1
4
+ version: 0.22.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bozhidar Batsov
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2022-08-28 00:00:00.000000000 Z
13
+ date: 2022-09-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubocop
@@ -54,41 +54,9 @@ executables: []
54
54
  extensions: []
55
55
  extra_rdoc_files: []
56
56
  files:
57
- - ".circleci/config.yml"
58
- - ".gitattributes"
59
- - ".github/FUNDING.yml"
60
- - ".github/ISSUE_TEMPLATE/bug_report.md"
61
- - ".github/ISSUE_TEMPLATE/feature_request.md"
62
- - ".github/PULL_REQUEST_TEMPLATE.md"
63
- - ".github/workflows/linting.yml"
64
- - ".github/workflows/spell_checking.yml"
65
- - ".gitignore"
66
- - ".rubocop.yml"
67
- - ".rubocop_todo.yml"
68
- - ".yamllint.yml"
69
- - ".yardopts"
70
- - CHANGELOG.md
71
- - CONTRIBUTING.md
72
- - Gemfile
73
57
  - LICENSE.txt
74
58
  - README.md
75
- - Rakefile
76
- - bin/console
77
- - bin/setup
78
- - codespell.txt
79
59
  - config/default.yml
80
- - docs/antora.yml
81
- - docs/modules/ROOT/nav.adoc
82
- - docs/modules/ROOT/pages/cops.adoc
83
- - docs/modules/ROOT/pages/cops_minitest.adoc
84
- - docs/modules/ROOT/pages/index.adoc
85
- - docs/modules/ROOT/pages/installation.adoc
86
- - docs/modules/ROOT/pages/usage.adoc
87
- - legacy-docs/cops.md
88
- - legacy-docs/cops_minitest.md
89
- - legacy-docs/index.md
90
- - legacy-docs/installation.md
91
- - legacy-docs/usage.md
92
60
  - lib/rubocop-minitest.rb
93
61
  - lib/rubocop/cop/generator.rb
94
62
  - lib/rubocop/cop/minitest/assert_empty.rb
@@ -104,6 +72,7 @@ files:
104
72
  - lib/rubocop/cop/minitest/assert_path_exists.rb
105
73
  - lib/rubocop/cop/minitest/assert_predicate.rb
106
74
  - lib/rubocop/cop/minitest/assert_raises_compound_body.rb
75
+ - lib/rubocop/cop/minitest/assert_raises_with_regexp_argument.rb
107
76
  - lib/rubocop/cop/minitest/assert_respond_to.rb
108
77
  - lib/rubocop/cop/minitest/assert_silent.rb
109
78
  - lib/rubocop/cop/minitest/assert_truthy.rb
@@ -142,52 +111,6 @@ files:
142
111
  - lib/rubocop/minitest/inject.rb
143
112
  - lib/rubocop/minitest/support.rb
144
113
  - lib/rubocop/minitest/version.rb
145
- - mkdocs.yml
146
- - readthedocs.yml
147
- - relnotes/v0.1.0.md
148
- - relnotes/v0.10.0.md
149
- - relnotes/v0.10.1.md
150
- - relnotes/v0.10.2.md
151
- - relnotes/v0.10.3.md
152
- - relnotes/v0.11.0.md
153
- - relnotes/v0.11.1.md
154
- - relnotes/v0.12.0.md
155
- - relnotes/v0.12.1.md
156
- - relnotes/v0.13.0.md
157
- - relnotes/v0.14.0.md
158
- - relnotes/v0.15.0.md
159
- - relnotes/v0.15.1.md
160
- - relnotes/v0.15.2.md
161
- - relnotes/v0.16.0.md
162
- - relnotes/v0.17.0.md
163
- - relnotes/v0.17.1.md
164
- - relnotes/v0.17.2.md
165
- - relnotes/v0.18.0.md
166
- - relnotes/v0.19.0.md
167
- - relnotes/v0.19.1.md
168
- - relnotes/v0.2.0.md
169
- - relnotes/v0.2.1.md
170
- - relnotes/v0.20.0.md
171
- - relnotes/v0.20.1.md
172
- - relnotes/v0.21.0.md
173
- - relnotes/v0.21.1.md
174
- - relnotes/v0.3.0.md
175
- - relnotes/v0.4.0.md
176
- - relnotes/v0.4.1.md
177
- - relnotes/v0.5.0.md
178
- - relnotes/v0.5.1.md
179
- - relnotes/v0.6.0.md
180
- - relnotes/v0.6.1.md
181
- - relnotes/v0.6.2.md
182
- - relnotes/v0.7.0.md
183
- - relnotes/v0.8.0.md
184
- - relnotes/v0.8.1.md
185
- - relnotes/v0.9.0.md
186
- - rubocop-minitest.gemspec
187
- - tasks/changelog.rake
188
- - tasks/changelog.rb
189
- - tasks/cops_documentation.rake
190
- - tasks/cut_release.rake
191
114
  homepage:
192
115
  licenses:
193
116
  - MIT
@@ -195,7 +118,7 @@ metadata:
195
118
  homepage_uri: https://docs.rubocop.org/rubocop-minitest/
196
119
  changelog_uri: https://github.com/rubocop/rubocop-minitest/blob/master/CHANGELOG.md
197
120
  source_code_uri: https://github.com/rubocop/rubocop-minitest
198
- documentation_uri: https://docs.rubocop.org/rubocop-minitest/0.21
121
+ documentation_uri: https://docs.rubocop.org/rubocop-minitest/0.22
199
122
  bug_tracker_uri: https://github.com/rubocop/rubocop-minitest/issues
200
123
  rubygems_mfa_required: 'true'
201
124
  post_install_message:
data/.circleci/config.yml DELETED
@@ -1,55 +0,0 @@
1
- version: 2.1
2
-
3
- jobs:
4
- rake_default:
5
- parameters:
6
- image:
7
- description: "Name of the Docker image."
8
- type: string
9
- default: "circleci/ruby"
10
- docker:
11
- - image: << parameters.image >>
12
- environment:
13
- # CircleCI container has two cores, but Ruby can see 32 cores. So we
14
- # configure test-queue.
15
- # See https://github.com/tmm1/test-queue#environment-variables
16
- TEST_QUEUE_WORKERS: 2
17
- JRUBY_OPTS: "--dev -J-Xmx1000M"
18
- steps:
19
- - checkout
20
- - run: bundle install
21
- - run: bundle exec rake
22
-
23
- # Miscellaneous tasks
24
- documentation-checks:
25
- docker:
26
- - image: circleci/ruby
27
- steps:
28
- - checkout
29
- - run: bundle install
30
- - run:
31
- name: Check documentation syntax
32
- command: bundle exec rake documentation_syntax_check
33
-
34
- workflows:
35
- build:
36
- jobs:
37
- - documentation-checks
38
- - rake_default:
39
- name: Ruby 2.6
40
- image: cimg/ruby:2.6
41
- - rake_default:
42
- name: Ruby 2.7
43
- image: cimg/ruby:2.7
44
- - rake_default:
45
- name: Ruby 3.0
46
- image: cimg/ruby:3.0
47
- - rake_default:
48
- name: Ruby 3.1
49
- image: cimg/ruby:3.1
50
- - rake_default:
51
- name: Ruby HEAD
52
- image: rubocophq/circleci-ruby-snapshot:latest # Nightly snapshot build
53
- - rake_default:
54
- name: JRuby 9.3
55
- image: circleci/jruby:9.3
data/.gitattributes DELETED
@@ -1 +0,0 @@
1
- CHANGELOG.md merge=union
data/.github/FUNDING.yml DELETED
@@ -1,7 +0,0 @@
1
- # These are supported funding model platforms
2
-
3
- github: [bbatsov, koic]
4
- patreon: bbatsov
5
- open_collective: rubocop
6
- tidelift: "rubygems/rubocop"
7
- custom: https://www.paypal.me/bbatsov
@@ -1,43 +0,0 @@
1
- ---
2
- name: Bug Report
3
- about: Report an issue with RuboCop Minitest you've discovered.
4
- ---
5
-
6
- *Be clear, concise and precise in your description of the problem.
7
- Open an issue with a descriptive title and a summary in grammatically correct,
8
- complete sentences.*
9
-
10
- *Use the template below when reporting bugs. Please, make sure that
11
- you're running the latest stable RuboCop and that the problem you're reporting
12
- hasn't been reported (and potentially fixed) already.*
13
-
14
- *Before filing the ticket you should replace all text above the horizontal
15
- rule with your own words.*
16
-
17
- --------
18
-
19
- ## Expected behavior
20
-
21
- Describe here how you expected RuboCop Minitest to behave in this particular situation.
22
-
23
- ## Actual behavior
24
-
25
- Describe here what actually happened.
26
-
27
- ## Steps to reproduce the problem
28
-
29
- This is extremely important! Providing us with a reliable way to reproduce
30
- a problem will expedite its solution.
31
-
32
- ## RuboCop version
33
-
34
- Include the output of `rubocop -V` or `bundle exec rubocop -V` if using Bundler. Here's an example:
35
- You see extension cop versions (e.g. rubocop-minitest, rubocop-performance, and others) output by rubocop -V,
36
- include them as well. Here's an example:
37
-
38
- ```
39
- $ [bundle exec] rubocop -V
40
- 1.10.0 (using Parser 3.0.0.0, rubocop-ast 1.4.1, running on ruby 3.0.0 x86_64-darwin19)
41
- - rubocop-minitest 0.10.3
42
- - rubocop-performance 1.9.2
43
- ```
@@ -1,20 +0,0 @@
1
- ---
2
- name: Feature Request
3
- about: Suggest new RuboCop Minitest features or improvements to existing features.
4
- ---
5
-
6
- ## Is your feature request related to a problem? Please describe.
7
-
8
- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9
-
10
- ## Describe the solution you'd like
11
-
12
- A clear and concise description of what you want to happen.
13
-
14
- ## Describe alternatives you've considered
15
-
16
- A clear and concise description of any alternative solutions or features you've considered.
17
-
18
- ## Additional context
19
-
20
- Add any other context or screenshots about the feature request here.
@@ -1,17 +0,0 @@
1
- **Replace this text with a summary of the changes in your PR.
2
- The more detailed you are, the better.**
3
-
4
- -----------------
5
-
6
- Before submitting the PR make sure the following are checked:
7
-
8
- * [ ] The PR relates to *only* one subject with a clear title and description in grammatically correct, complete sentences.
9
- * [ ] Wrote [good commit messages][1].
10
- * [ ] Commit message starts with `[Fix #issue-number]` (if the related issue exists).
11
- * [ ] Feature branch is up-to-date with `master` (if not - rebase it).
12
- * [ ] Squashed related commits together.
13
- * [ ] Added tests.
14
- * [ ] Ran `bundle exec rake default`. It executes all tests and runs RuboCop on its own code.
15
- * [ ] Added an entry (file) to the [changelog folder](https://github.com/rubocop/rubocop-minitest/blob/master/changelog/) named `{change_type}_{change_description}.md` if the new code introduces user-observable changes. See [changelog entry format](https://github.com/rubocop/rubocop/blob/master/CONTRIBUTING.md#changelog-entry-format) for details.
16
-
17
- [1]: https://chris.beams.io/posts/git-commit/
@@ -1,15 +0,0 @@
1
- name: Linting
2
- on:
3
- - pull_request
4
- jobs:
5
- yamllint:
6
- name: Yamllint
7
- runs-on: ubuntu-latest
8
- steps:
9
- - uses: actions/checkout@v3
10
- - name: Yamllint
11
- uses: karancode/yamllint-github-action@master
12
- with:
13
- yamllint_comment: true
14
- env:
15
- GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -1,33 +0,0 @@
1
- name: Spell Checking
2
-
3
- on: [pull_request]
4
-
5
- jobs:
6
- codespell:
7
- name: Check spelling of all files with codespell
8
- runs-on: ubuntu-latest
9
- strategy:
10
- matrix:
11
- python-version: [3.8]
12
- steps:
13
- - uses: actions/checkout@v3
14
- - name: Set up Python ${{ matrix.python-version }}
15
- uses: actions/setup-python@v2
16
- with:
17
- python-version: ${{ matrix.python-version }}
18
- - name: Install dependencies
19
- run: |
20
- python -m pip install --upgrade pip
21
- pip install codespell
22
- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
23
- - name: Check spelling with codespell
24
- run: codespell --ignore-words=codespell.txt || exit 1
25
- misspell:
26
- name: Check spelling of all files in commit with misspell
27
- runs-on: ubuntu-latest
28
- steps:
29
- - uses: actions/checkout@v3
30
- - name: Install
31
- run: wget -O - -q https://raw.githubusercontent.com/client9/misspell/master/install-misspell.sh | sh -s -- -b .
32
- - name: Misspell
33
- run: git ls-files --empty-directory | xargs ./misspell -error
data/.gitignore DELETED
@@ -1,61 +0,0 @@
1
- # rcov generated
2
- coverage
3
- coverage.data
4
-
5
- # rdoc generated
6
- rdoc
7
-
8
- # yard generated
9
- doc
10
- .yardoc
11
-
12
- # bundler
13
- .bundle
14
- Gemfile.lock
15
- Gemfile.local
16
-
17
- # rbenv
18
- .ruby-version
19
-
20
- # rspec
21
- /spec/examples.txt
22
- /.test_queue_stats
23
-
24
- # jeweler generated
25
- pkg
26
-
27
- # etags
28
- TAGS
29
-
30
- # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
31
- #
32
- # * Create a file at ~/.gitignore
33
- # * Include files you want ignored
34
- # * Run: git config --global core.excludesfile ~/.gitignore
35
- #
36
- # After doing this, these files will be ignored in all your git projects,
37
- # saving you from having to 'pollute' every project you touch with them
38
- #
39
- # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
40
- #
41
- # For MacOS:
42
- #
43
- #.DS_Store
44
-
45
- # For TextMate
46
- #*.tmproj
47
- #tmtags
48
-
49
- # For emacs:
50
- #*~
51
- #\#*
52
- #.\#*
53
-
54
- # For vim:
55
- *.swp
56
-
57
- # For redcar:
58
- #.redcar
59
-
60
- # For rubinius:
61
- #*.rbc
data/.rubocop.yml DELETED
@@ -1,110 +0,0 @@
1
- inherit_from: .rubocop_todo.yml
2
-
3
- # This is the configuration used to check the rubocop source code.
4
-
5
- require:
6
- - rubocop/cop/internal_affairs
7
- - rubocop-performance
8
- - rubocop-minitest
9
-
10
- AllCops:
11
- NewCops: enable
12
- TargetRubyVersion: 2.6
13
- SuggestExtensions: false
14
-
15
- InternalAffairs/NodeMatcherDirective:
16
- Enabled: false
17
-
18
- # FIXME: Workaround for a false positive caused by this cop when using `bundle exec rake`.
19
- InternalAffairs/UndefinedConfig:
20
- Enabled: false
21
-
22
- Naming/PredicateName:
23
- # Method define macros for dynamically generated method.
24
- MethodDefinitionMacros:
25
- - define_method
26
- - define_singleton_method
27
- - def_node_matcher
28
- - def_node_search
29
-
30
- Naming/InclusiveLanguage:
31
- Enabled: true
32
- CheckStrings: true
33
- FlaggedTerms:
34
- auto-correct:
35
- Suggestions:
36
- - autocorrect
37
- auto_correct:
38
- Suggestions:
39
- - autocorrect
40
- behaviour:
41
- Suggestions:
42
- - behavior
43
- offence:
44
- Suggestions:
45
- - offense
46
-
47
- Style/FormatStringToken:
48
- # Because we parse a lot of source codes from strings. Percent arrays
49
- # look like unannotated format string tokens to this cop.
50
- Exclude:
51
- - test/**/*
52
-
53
- Metrics/ClassLength:
54
- Exclude:
55
- - test/**/*
56
- - tasks/changelog.rb
57
-
58
- Layout/EndOfLine:
59
- EnforcedStyle: lf
60
-
61
- Layout/ClassStructure:
62
- Enabled: true
63
- Categories:
64
- module_inclusion:
65
- - include
66
- - prepend
67
- - extend
68
- ExpectedOrder:
69
- - module_inclusion
70
- - constants
71
- - public_class_methods
72
- - initializer
73
- - instance_methods
74
- - protected_methods
75
- - private_methods
76
-
77
- Layout/RedundantLineBreak:
78
- Enabled: true
79
-
80
- # Trailing white space is meaningful in code examples
81
- Layout/TrailingWhitespace:
82
- AllowInHeredoc: true
83
-
84
- Lint/AmbiguousBlockAssociation:
85
- Exclude:
86
- - 'test/**/*.rb'
87
-
88
- Lint/InterpolationCheck:
89
- Exclude:
90
- - 'test/**/*.rb'
91
-
92
- Lint/UselessAccessModifier:
93
- MethodCreatingMethods:
94
- - 'def_matcher'
95
- - 'def_node_matcher'
96
-
97
- Metrics/BlockLength:
98
- Exclude:
99
- - 'Rakefile'
100
- - '**/*.rake'
101
- - 'test/**/*.rb'
102
- - 'rubocop-minitest.gemspec'
103
-
104
- Naming/FileName:
105
- Exclude:
106
- - lib/rubocop-minitest.rb
107
-
108
- Metrics/ModuleLength:
109
- Exclude:
110
- - 'test/**/*.rb'