rubocop-minitest 0.9.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +18 -0
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +5 -1
  4. data/.rubocop.yml +5 -3
  5. data/.rubocop_todo.yml +8 -7
  6. data/CHANGELOG.md +94 -37
  7. data/CONTRIBUTING.md +3 -3
  8. data/Gemfile +2 -2
  9. data/LICENSE.txt +1 -1
  10. data/README.md +20 -4
  11. data/Rakefile +29 -0
  12. data/bin/console +2 -0
  13. data/config/default.yml +100 -16
  14. data/docs/antora.yml +7 -0
  15. data/docs/modules/ROOT/nav.adoc +6 -0
  16. data/docs/modules/ROOT/pages/cops.adoc +49 -0
  17. data/docs/modules/ROOT/pages/cops_minitest.adoc +1050 -0
  18. data/docs/modules/ROOT/pages/index.adoc +5 -0
  19. data/docs/modules/ROOT/pages/installation.adoc +15 -0
  20. data/docs/modules/ROOT/pages/usage.adoc +32 -0
  21. data/{manual → legacy-docs}/cops.md +0 -0
  22. data/{manual → legacy-docs}/cops_minitest.md +16 -16
  23. data/legacy-docs/index.md +1 -0
  24. data/{manual → legacy-docs}/installation.md +0 -0
  25. data/{manual → legacy-docs}/usage.md +0 -0
  26. data/lib/rubocop/cop/generator.rb +56 -0
  27. data/lib/rubocop/cop/minitest/assert_empty_literal.rb +23 -7
  28. data/lib/rubocop/cop/minitest/assert_in_delta.rb +29 -0
  29. data/lib/rubocop/cop/minitest/assert_kind_of.rb +25 -0
  30. data/lib/rubocop/cop/minitest/assert_nil.rb +1 -0
  31. data/lib/rubocop/cop/minitest/assert_output.rb +49 -0
  32. data/lib/rubocop/cop/minitest/assert_path_exists.rb +59 -0
  33. data/lib/rubocop/cop/minitest/assert_silent.rb +45 -0
  34. data/lib/rubocop/cop/minitest/assert_truthy.rb +1 -0
  35. data/lib/rubocop/cop/minitest/assert_with_expected_argument.rb +38 -0
  36. data/lib/rubocop/cop/minitest/assertion_in_lifecycle_hook.rb +43 -0
  37. data/lib/rubocop/cop/minitest/global_expectations.rb +4 -4
  38. data/lib/rubocop/cop/minitest/literal_as_actual_argument.rb +53 -0
  39. data/lib/rubocop/cop/minitest/multiple_assertions.rb +63 -0
  40. data/lib/rubocop/cop/minitest/refute_equal.rb +2 -1
  41. data/lib/rubocop/cop/minitest/refute_false.rb +1 -0
  42. data/lib/rubocop/cop/minitest/refute_in_delta.rb +29 -0
  43. data/lib/rubocop/cop/minitest/refute_kind_of.rb +25 -0
  44. data/lib/rubocop/cop/minitest/refute_nil.rb +1 -0
  45. data/lib/rubocop/cop/minitest/refute_path_exists.rb +59 -0
  46. data/lib/rubocop/cop/minitest/test_method_name.rb +79 -0
  47. data/lib/rubocop/cop/minitest/unspecified_exception.rb +36 -0
  48. data/lib/rubocop/cop/minitest_cops.rb +16 -0
  49. data/lib/rubocop/cop/mixin/argument_range_helper.rb +10 -0
  50. data/lib/rubocop/cop/mixin/in_delta_mixin.rb +50 -0
  51. data/lib/rubocop/cop/mixin/minitest_cop_rule.rb +2 -1
  52. data/lib/rubocop/cop/mixin/minitest_exploration_helpers.rb +97 -0
  53. data/lib/rubocop/minitest/version.rb +8 -1
  54. data/mkdocs.yml +4 -4
  55. data/relnotes/v0.1.0.md +1 -1
  56. data/relnotes/v0.10.0.md +21 -0
  57. data/relnotes/v0.10.1.md +5 -0
  58. data/relnotes/v0.10.2.md +5 -0
  59. data/relnotes/v0.10.3.md +5 -0
  60. data/relnotes/v0.11.0.md +16 -0
  61. data/relnotes/v0.2.0.md +4 -4
  62. data/relnotes/v0.2.1.md +1 -1
  63. data/relnotes/v0.3.0.md +6 -6
  64. data/relnotes/v0.4.0.md +5 -5
  65. data/relnotes/v0.4.1.md +1 -1
  66. data/relnotes/v0.5.0.md +1 -1
  67. data/relnotes/v0.5.1.md +1 -1
  68. data/relnotes/v0.6.0.md +1 -1
  69. data/relnotes/v0.6.1.md +2 -2
  70. data/relnotes/v0.6.2.md +1 -1
  71. data/relnotes/v0.7.0.md +5 -5
  72. data/relnotes/v0.8.0.md +4 -4
  73. data/relnotes/v0.8.1.md +1 -1
  74. data/relnotes/v0.9.0.md +3 -3
  75. data/rubocop-minitest.gemspec +7 -7
  76. data/tasks/cops_documentation.rake +15 -264
  77. data/tasks/cut_release.rake +16 -0
  78. metadata +55 -20
  79. data/manual/index.md +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c082e4d082877168b339446bf00e74f719a3903d7ae2a19dc6b919af185c9c20
4
- data.tar.gz: b77c805249d256213f7b166579244db96ce188e8dbe8ca7d156d14a4c74e77b5
3
+ metadata.gz: 81e45de61660959fcc0e02a2dd6754d7042cb167b1ef5277d327563e8bb2277c
4
+ data.tar.gz: 0f36c86abdde0b5b23dd2672f295a4383da2f5ff68b8414e96bb4f932c4eb7bc
5
5
  SHA512:
6
- metadata.gz: 348081b691b1afc2fc563d594482a8e19b3b5f487c18e4e51320e2be6c9e76fe89ea8c6badfcd4327f7c3da8a13b5aa8293e3535ce7385083edec466fedee769
7
- data.tar.gz: 383422b5cc623d52cef4f0656da57e4b648d85c00699006d317837172dc06c97f182f660e15a7704cd5f13803e12af31912db41aed9f003223149b8cd64f5b51
6
+ metadata.gz: c643b9d4e81ce5f966e11cebe55c40359799130eba6591a52cf7b10dca759b289167ede842a89eb3bf0f62119fbc189a28e1da611cb82afaa825662bc271aa6a
7
+ data.tar.gz: 15aab2f0884dd25ef98e61b1728736f21311004c06d1d8b86454bb2bc4f9367e31e558b8843315fb1f3d7502f11ffea5ec1cbfb5acddd966bf373c4ad0b01482
data/.circleci/config.yml CHANGED
@@ -20,9 +20,24 @@ jobs:
20
20
  - run: bundle install
21
21
  - run: bundle exec rake
22
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
+ - run:
34
+ name: Build documentation and verify that doc files are in sync
35
+ command: bundle exec rake verify_cops_documentation
36
+
23
37
  workflows:
24
38
  build:
25
39
  jobs:
40
+ - documentation-checks
26
41
  - rake_default:
27
42
  name: Ruby 2.4
28
43
  image: circleci/ruby:2.4
@@ -35,6 +50,9 @@ workflows:
35
50
  - rake_default:
36
51
  name: Ruby 2.7
37
52
  image: circleci/ruby:2.7
53
+ - rake_default:
54
+ name: Ruby 3.0
55
+ image: circleci/ruby:3.0
38
56
  - rake_default:
39
57
  name: Ruby HEAD
40
58
  image: rubocophq/circleci-ruby-snapshot:latest # Nightly snapshot build
@@ -32,8 +32,12 @@ a problem will expedite its solution.
32
32
  ## RuboCop version
33
33
 
34
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:
35
37
 
36
38
  ```
37
39
  $ [bundle exec] rubocop -V
38
- 0.74.0 (using Parser 2.6.4.0, running on ruby 2.6.4 x86_64-darwin17)
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
39
43
  ```
data/.rubocop.yml CHANGED
@@ -8,7 +8,12 @@ require:
8
8
  - rubocop-minitest
9
9
 
10
10
  AllCops:
11
+ NewCops: enable
11
12
  TargetRubyVersion: 2.4
13
+ SuggestExtensions: false
14
+
15
+ InternalAffairs/NodeMatcherDirective:
16
+ Enabled: false
12
17
 
13
18
  Naming/PredicateName:
14
19
  # Method define macros for dynamically generated method.
@@ -47,9 +52,6 @@ Layout/ClassStructure:
47
52
  - protected_methods
48
53
  - private_methods
49
54
 
50
- Layout/LineLength:
51
- Max: 120
52
-
53
55
  # Trailing white space is meaningful in code examples
54
56
  Layout/TrailingWhitespace:
55
57
  AllowInHeredoc: true
data/.rubocop_todo.yml CHANGED
@@ -1,16 +1,17 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2019-12-21 01:15:41 +0900 using RuboCop version 0.78.0.
3
+ # on 2020-10-29 02:01:16 UTC using RuboCop version 1.0.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 2
10
- Metrics/AbcSize:
11
- Max: 17
12
-
13
- # Offense count: 19
14
- # Configuration parameters: CountComments, ExcludedMethods.
9
+ # Offense count: 22
10
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
15
11
  Metrics/MethodLength:
16
12
  Max: 14
13
+
14
+ # Offense count: 1
15
+ Style/DocumentDynamicEvalDefinition:
16
+ Exclude:
17
+ - 'lib/rubocop/cop/mixin/minitest_cop_rule.rb'
data/CHANGELOG.md CHANGED
@@ -2,133 +2,186 @@
2
2
 
3
3
  ## master (unreleased)
4
4
 
5
+ ## 0.11.0 (2021-03-22)
6
+
7
+ ### New features
8
+
9
+ * [#117](https://github.com/rubocop/rubocop-minitest/issues/117): Add new cop `Minitest/AssertWithExpectedArgument` to check for unintended usages of `assert` instead of `assert_equal`. ([@cstyles][])
10
+
11
+ ### Bug fixes
12
+
13
+ * [#122](https://github.com/rubocop/rubocop-minitest/pull/122): Fix `Minitest/TestMethodName` for tests with multiple assertions. ([@ghiculescu][])
14
+
15
+ ### Changes
16
+
17
+ * [#118](https://github.com/rubocop/rubocop-minitest/pull/118): **(BREAKING)** Fix `Minitest/AssertEmptyLiteral` by making it check for `assert_equal([], array)` instead of `assert([], array)`. ([@cstyles][])
18
+ * [#125](https://github.com/rubocop/rubocop-minitest/pull/125): Require RuboCop 0.90 or higher. ([@koic][])
19
+
20
+ ## 0.10.3 (2021-01-12)
21
+
22
+ ### Bug fixes
23
+
24
+ * [#115](https://github.com/rubocop/rubocop-minitest/issues/115): Fix a false positive for `Minitest/TestMethodName` for when defining test method has an argument, and test method without assertion methods. ([@koic][])
25
+
26
+ ## 0.10.2 (2020-12-27)
27
+
28
+ ### Bug fixes
29
+
30
+ * [#113](https://github.com/rubocop/rubocop-minitest/issues/113): Fix an error for `Minitest/AssertEqual` and some cops when using `assert` with block argument. ([@koic][])
31
+
32
+ ## 0.10.1 (2020-07-25)
33
+
34
+ ### Bug fixes
35
+
36
+ * [#106](https://github.com/rubocop/rubocop-minitest/issues/106): Fix an error for `Minitest/AssertOutput` when using gvar at top level. ([@koic][])
37
+
38
+ ## 0.10.0 (2020-07-12)
39
+
40
+ ### New features
41
+
42
+ * [#92](https://github.com/rubocop/rubocop-minitest/pull/92): Add new `Minitest/LiteralAsActualArgument` cop. ([@fatkodima][], [@tsmmark][])
43
+ * [#95](https://github.com/rubocop/rubocop-minitest/pull/95): Add new `Minitest/AssertionInLifecycleHook` cop. ([@fatkodima][])
44
+ * [#91](https://github.com/rubocop/rubocop-minitest/pull/91): Add new `Minitest/AssertInDelta` and `Minitest/RefuteInDelta` cops. ([@fatkodima][])
45
+ * [#89](https://github.com/rubocop/rubocop-minitest/pull/89): Add new `Minitest/TestMethodName` cop. ([@fatkodima][])
46
+ * [#83](https://github.com/rubocop/rubocop-minitest/pull/83): New cops `AssertPathExists` and `RefutePathExists` check for use of `assert_path_exists`/`refute_path_exists` instead of `assert(File.exist?(path))`/`refute(File.exist?(path))`. ([@fatkodima][])
47
+ * [#88](https://github.com/rubocop/rubocop-minitest/pull/88): Add new `Minitest/MultipleAssertions` cop. ([@fatkodima][])
48
+ * [#87](https://github.com/rubocop/rubocop-minitest/pull/87): Add new `Minitest/AssertSilent` cop. ([@fatkodima][])
49
+ * [#96](https://github.com/rubocop/rubocop-minitest/pull/96): Add new `Minitest/UnspecifiedException` cop. ([@fatkodima][])
50
+ * [#98](https://github.com/rubocop/rubocop-minitest/pull/98): Add new `Minitest/AssertOutput` cop. ([@fatkodima][])
51
+ * [#84](https://github.com/rubocop/rubocop-minitest/pull/84): New cops `AssertKindOf` and `RefuteKindOf` check for use of `assert_kind_of`/`refute_kind_of` instead of `assert(foo.kind_of?(Class))`/`refute(foo.kind_of?(Class))`. ([@fatkodima][])
52
+ * [#85](https://github.com/rubocop/rubocop-minitest/pull/85): Add autocorrect to `Rails/AssertEmptyLiteral` cop. ([@fatkodima][])
53
+
54
+ ### Changes
55
+
56
+ * [#104](https://github.com/rubocop/rubocop-minitest/pull/104): Require RuboCop 0.87 or higher. ([@koic][])
57
+
5
58
  ## 0.9.0 (2020-04-13)
6
59
 
7
60
  ### Bug fixes
8
61
 
9
- * [#75](https://github.com/rubocop-hq/rubocop-minitest/issues/75): Fix a false negative for `Minitest/GlobalExpectations` when using global expectation methods with no arguments. ([@koic][])
62
+ * [#75](https://github.com/rubocop/rubocop-minitest/issues/75): Fix a false negative for `Minitest/GlobalExpectations` when using global expectation methods with no arguments. ([@koic][])
10
63
 
11
64
  ### Changes
12
65
 
13
- * [#73](https://github.com/rubocop-hq/rubocop-minitest/issues/73): The Minitest department works on file names end with `_test.rb` by default. ([@koic][])
14
- * [#77](https://github.com/rubocop-hq/rubocop-minitest/pull/77): **(BREAKING)** Drop support for Ruby 2.3. ([@koic][])
66
+ * [#73](https://github.com/rubocop/rubocop-minitest/issues/73): The Minitest department works on file names end with `_test.rb` by default. ([@koic][])
67
+ * [#77](https://github.com/rubocop/rubocop-minitest/pull/77): **(BREAKING)** Drop support for Ruby 2.3. ([@koic][])
15
68
 
16
69
  ## 0.8.1 (2020-04-06)
17
70
 
18
71
  ### Bug fixes
19
72
 
20
- * [#72](https://github.com/rubocop-hq/rubocop-minitest/pull/72): Fix some false negatives for `Minitest/GlobalExpectations`. ([@andrykonchin][])
73
+ * [#72](https://github.com/rubocop/rubocop-minitest/pull/72): Fix some false negatives for `Minitest/GlobalExpectations`. ([@andrykonchin][])
21
74
 
22
75
  ## 0.8.0 (2020-03-24)
23
76
 
24
77
  ### New features
25
78
 
26
- * [#66](https://github.com/rubocop-hq/rubocop-minitest/issues/66): Support all expectations of `Minitest::Expectations` for `Minitest/GlobalExpectations` cop. ([@koic][])
79
+ * [#66](https://github.com/rubocop/rubocop-minitest/issues/66): Support all expectations of `Minitest::Expectations` for `Minitest/GlobalExpectations` cop. ([@koic][])
27
80
 
28
81
  ### Bug fixes
29
82
 
30
- * [#60](https://github.com/rubocop-hq/rubocop-minitest/issues/60): Fix `Minitest/GlobalExpectations` autocorrection for chained methods. ([@tejasbubane][])
31
- * [#69](https://github.com/rubocop-hq/rubocop-minitest/pull/69): Fix a false negative for `Minitest/GlobalExpectations` cop when using a variable or a hash index for receiver. ([@koic][])
32
- * [#71](https://github.com/rubocop-hq/rubocop-minitest/pull/71): Fix a false negative for `Minitest/AssertEqual` when an argument is enclosed in redundant parentheses. ([@koic][])
83
+ * [#60](https://github.com/rubocop/rubocop-minitest/issues/60): Fix `Minitest/GlobalExpectations` autocorrection for chained methods. ([@tejasbubane][])
84
+ * [#69](https://github.com/rubocop/rubocop-minitest/pull/69): Fix a false negative for `Minitest/GlobalExpectations` cop when using a variable or a hash index for receiver. ([@koic][])
85
+ * [#71](https://github.com/rubocop/rubocop-minitest/pull/71): Fix a false negative for `Minitest/AssertEqual` when an argument is enclosed in redundant parentheses. ([@koic][])
33
86
 
34
87
  ## 0.7.0 (2020-03-09)
35
88
 
36
89
  ### New features
37
90
 
38
- * [#60](https://github.com/rubocop-hq/rubocop-minitest/issues/60): Add new cop `Minitest/GlobalExpectations` to check for deprecated global expectations. ([@tejasbubane][])
91
+ * [#60](https://github.com/rubocop/rubocop-minitest/issues/60): Add new cop `Minitest/GlobalExpectations` to check for deprecated global expectations. ([@tejasbubane][])
39
92
 
40
93
  ### Bug fixes
41
94
 
42
- * [#58](https://github.com/rubocop-hq/rubocop-minitest/pull/58): Fix a false negative for `Minitest/AssertMatch` and `Minitest/RefuteMatch` when an argument is enclosed in redundant parentheses. ([@koic][])
43
- * [#59](https://github.com/rubocop-hq/rubocop-minitest/pull/59): Fix a false negative for `Minitest/AssertRespondTo` and `Minitest/RefuteRespondTo` when an argument is enclosed in redundant parentheses. ([@koic][])
44
- * [#61](https://github.com/rubocop-hq/rubocop-minitest/pull/61): Fix a false negative for `Minitest/AssertInstanceOf` and `Minitest/RefuteInstanceOf` when an argument is enclosed in redundant parentheses. ([@koic][])
45
- * [#62](https://github.com/rubocop-hq/rubocop-minitest/pull/62): Fix a false negative for `Minitest/AssertEmpty` and `Minitest/RefuteEmpty` when an argument is enclosed in redundant parentheses. ([@koic][])
95
+ * [#58](https://github.com/rubocop/rubocop-minitest/pull/58): Fix a false negative for `Minitest/AssertMatch` and `Minitest/RefuteMatch` when an argument is enclosed in redundant parentheses. ([@koic][])
96
+ * [#59](https://github.com/rubocop/rubocop-minitest/pull/59): Fix a false negative for `Minitest/AssertRespondTo` and `Minitest/RefuteRespondTo` when an argument is enclosed in redundant parentheses. ([@koic][])
97
+ * [#61](https://github.com/rubocop/rubocop-minitest/pull/61): Fix a false negative for `Minitest/AssertInstanceOf` and `Minitest/RefuteInstanceOf` when an argument is enclosed in redundant parentheses. ([@koic][])
98
+ * [#62](https://github.com/rubocop/rubocop-minitest/pull/62): Fix a false negative for `Minitest/AssertEmpty` and `Minitest/RefuteEmpty` when an argument is enclosed in redundant parentheses. ([@koic][])
46
99
 
47
100
  ## 0.6.2 (2020-02-19)
48
101
 
49
102
  ### Bug fixes
50
103
 
51
- * [#55](https://github.com/rubocop-hq/rubocop-minitest/issues/55): Fix an error for `Minitest/AssertIncludes` when using local variable argument. ([@koic][])
104
+ * [#55](https://github.com/rubocop/rubocop-minitest/issues/55): Fix an error for `Minitest/AssertIncludes` when using local variable argument. ([@koic][])
52
105
 
53
106
  ## 0.6.1 (2020-02-18)
54
107
 
55
108
  ### Bug fixes
56
109
 
57
- * [#52](https://github.com/rubocop-hq/rubocop-minitest/issues/52): Make `Minitest/RefuteFalse` cop aware of `assert(!test)`. ([@koic][])
58
- * [#52](https://github.com/rubocop-hq/rubocop-minitest/issues/52): Fix a false negative for `Minitest/AssertIncludes` and `Minitest/RefuteIncludes` when an argument is enclosed in redundant parentheses. ([@koic][])
110
+ * [#52](https://github.com/rubocop/rubocop-minitest/issues/52): Make `Minitest/RefuteFalse` cop aware of `assert(!test)`. ([@koic][])
111
+ * [#52](https://github.com/rubocop/rubocop-minitest/issues/52): Fix a false negative for `Minitest/AssertIncludes` and `Minitest/RefuteIncludes` when an argument is enclosed in redundant parentheses. ([@koic][])
59
112
 
60
113
  ## 0.6.0 (2020-02-07)
61
114
 
62
115
  ### New features
63
116
 
64
- * [#49](https://github.com/rubocop-hq/rubocop-minitest/pull/49): New cops `AssertMatch` and `RefuteMatch` check for use of `assert_match`/`refute_match` instead of `assert(foo.match(bar))`/`refute(foo.match(bar))`. ([@fsateler][])
117
+ * [#49](https://github.com/rubocop/rubocop-minitest/pull/49): New cops `AssertMatch` and `RefuteMatch` check for use of `assert_match`/`refute_match` instead of `assert(foo.match(bar))`/`refute(foo.match(bar))`. ([@fsateler][])
65
118
 
66
119
  ## 0.5.1 (2019-12-25)
67
120
 
68
121
  ### Bug fixes
69
122
 
70
- * [#42](https://github.com/rubocop-hq/rubocop-minitest/issues/42): Fix an incorrect autocorrect for some cops of `Minitest` department when using heredoc message. ([@koic][])
123
+ * [#42](https://github.com/rubocop/rubocop-minitest/issues/42): Fix an incorrect autocorrect for some cops of `Minitest` department when using heredoc message. ([@koic][])
71
124
 
72
125
  ## 0.5.0 (2019-11-24)
73
126
 
74
127
  ### New features
75
128
 
76
- * [#32](https://github.com/rubocop-hq/rubocop-minitest/issues/32): Add new `Minitest/AssertEmptyLiteral` cop. ([@tejasbubane][])
129
+ * [#32](https://github.com/rubocop/rubocop-minitest/issues/32): Add new `Minitest/AssertEmptyLiteral` cop. ([@tejasbubane][])
77
130
 
78
131
  ## 0.4.1 (2019-11-10)
79
132
 
80
133
  ### Bug fixes
81
134
 
82
- * [#39](https://github.com/rubocop-hq/rubocop-minitest/issues/39): Fix an incorrect autocorrect for `Minitest/AssertRespondTo` and `Minitest/RefuteRespondTo` when using assertion method calling `respond_to` with receiver omitted. ([@koic][])
135
+ * [#39](https://github.com/rubocop/rubocop-minitest/issues/39): Fix an incorrect autocorrect for `Minitest/AssertRespondTo` and `Minitest/RefuteRespondTo` when using assertion method calling `respond_to` with receiver omitted. ([@koic][])
83
136
 
84
137
  ## 0.4.0 (2019-11-07)
85
138
 
86
139
  ### New features
87
140
 
88
- * [#29](https://github.com/rubocop-hq/rubocop-minitest/pull/29): Add new `Minitest/RefuteRespondTo` cop. ([@herwinw][])
89
- * [#31](https://github.com/rubocop-hq/rubocop-minitest/pull/31): Add new `Minitest/AssertEqual` cop. ([@herwinw][])
90
- * [#34](https://github.com/rubocop-hq/rubocop-minitest/pull/34): Add new `Minitest/AssertInstanceOf` cop. ([@abhaynikam][])
91
- * [#35](https://github.com/rubocop-hq/rubocop-minitest/pull/35): Add new `Minitest/RefuteInstanceOf` cop. ([@abhaynikam][])
141
+ * [#29](https://github.com/rubocop/rubocop-minitest/pull/29): Add new `Minitest/RefuteRespondTo` cop. ([@herwinw][])
142
+ * [#31](https://github.com/rubocop/rubocop-minitest/pull/31): Add new `Minitest/AssertEqual` cop. ([@herwinw][])
143
+ * [#34](https://github.com/rubocop/rubocop-minitest/pull/34): Add new `Minitest/AssertInstanceOf` cop. ([@abhaynikam][])
144
+ * [#35](https://github.com/rubocop/rubocop-minitest/pull/35): Add new `Minitest/RefuteInstanceOf` cop. ([@abhaynikam][])
92
145
 
93
146
  ### Bug fixes
94
147
 
95
- * [#25](https://github.com/rubocop-hq/rubocop-minitest/issues/25): Add `Enabled: true` to `Minitest` department config to suppress `Warning: Minitest does not support Enabled parameter`. ([@koic][])
148
+ * [#25](https://github.com/rubocop/rubocop-minitest/issues/25): Add `Enabled: true` to `Minitest` department config to suppress `Warning: Minitest does not support Enabled parameter`. ([@koic][])
96
149
 
97
150
  ## 0.3.0 (2019-10-13)
98
151
 
99
152
  ### New features
100
153
 
101
- * [#15](https://github.com/rubocop-hq/rubocop-minitest/pull/15): Add new `Minitest/RefuteIncludes` cop. ([@abhaynikam][])
102
- * [#18](https://github.com/rubocop-hq/rubocop-minitest/pull/18): Add new `Minitest/RefuteFalse` cop. ([@duduribeiro][])
103
- * [#20](https://github.com/rubocop-hq/rubocop-minitest/pull/20): Add new `Minitest/RefuteEmpty` cop. ([@abhaynikam][])
104
- * [#21](https://github.com/rubocop-hq/rubocop-minitest/pull/21): Add new `Minitest/RefuteEqual` cop. ([@duduribeiro][])
105
- * [#27](https://github.com/rubocop-hq/rubocop-minitest/pull/27): Add new `Minitest/AssertRespondTo` cop. ([@duduribeiro][])
154
+ * [#15](https://github.com/rubocop/rubocop-minitest/pull/15): Add new `Minitest/RefuteIncludes` cop. ([@abhaynikam][])
155
+ * [#18](https://github.com/rubocop/rubocop-minitest/pull/18): Add new `Minitest/RefuteFalse` cop. ([@duduribeiro][])
156
+ * [#20](https://github.com/rubocop/rubocop-minitest/pull/20): Add new `Minitest/RefuteEmpty` cop. ([@abhaynikam][])
157
+ * [#21](https://github.com/rubocop/rubocop-minitest/pull/21): Add new `Minitest/RefuteEqual` cop. ([@duduribeiro][])
158
+ * [#27](https://github.com/rubocop/rubocop-minitest/pull/27): Add new `Minitest/AssertRespondTo` cop. ([@duduribeiro][])
106
159
 
107
160
  ### Bug fixes
108
161
 
109
- * [#19](https://github.com/rubocop-hq/rubocop-minitest/pull/19): Fix a false negative for `Minitest/AssertIncludes` when using `include` method in arguments of `assert` method. ([@abhaynikam][])
162
+ * [#19](https://github.com/rubocop/rubocop-minitest/pull/19): Fix a false negative for `Minitest/AssertIncludes` when using `include` method in arguments of `assert` method. ([@abhaynikam][])
110
163
 
111
164
  ## 0.2.1 (2019-09-24)
112
165
 
113
166
  ### Bug fixes
114
167
 
115
- * [#13](https://github.com/rubocop-hq/rubocop-minitest/issues/13): Fix the execution target specified in `Include` parameter. ([@koic][])
168
+ * [#13](https://github.com/rubocop/rubocop-minitest/issues/13): Fix the execution target specified in `Include` parameter. ([@koic][])
116
169
 
117
170
  ## 0.2.0 (2019-09-21)
118
171
 
119
172
  ### New features
120
173
 
121
- * [#11](https://github.com/rubocop-hq/rubocop-minitest/pull/11): Add new `Minitest/RefuteNil` cop. ([@tejasbubane][])
122
- * [#8](https://github.com/rubocop-hq/rubocop-minitest/pull/8): Add new `Minitest/AssertTruthy` cop. ([@abhaynikam][])
123
- * [#9](https://github.com/rubocop-hq/rubocop-minitest/pull/9): Add new `Minitest/AssertIncludes` cop. ([@abhaynikam][])
124
- * [#10](https://github.com/rubocop-hq/rubocop-minitest/pull/10): Add new `Minitest/AssertEmpty` cop. ([@abhaynikam][])
174
+ * [#11](https://github.com/rubocop/rubocop-minitest/pull/11): Add new `Minitest/RefuteNil` cop. ([@tejasbubane][])
175
+ * [#8](https://github.com/rubocop/rubocop-minitest/pull/8): Add new `Minitest/AssertTruthy` cop. ([@abhaynikam][])
176
+ * [#9](https://github.com/rubocop/rubocop-minitest/pull/9): Add new `Minitest/AssertIncludes` cop. ([@abhaynikam][])
177
+ * [#10](https://github.com/rubocop/rubocop-minitest/pull/10): Add new `Minitest/AssertEmpty` cop. ([@abhaynikam][])
125
178
 
126
179
  ## 0.1.0 (2019-09-01)
127
180
 
128
181
  ### New features
129
182
 
130
183
  * Create RuboCop Minitest gem. ([@koic][])
131
- * [#6](https://github.com/rubocop-hq/rubocop-minitest/pull/6): Add new `Minitest/AssertNil` cop. ([@duduribeiro][])
184
+ * [#6](https://github.com/rubocop/rubocop-minitest/pull/6): Add new `Minitest/AssertNil` cop. ([@duduribeiro][])
132
185
 
133
186
  [@koic]: https://github.com/koic
134
187
  [@duduribeiro]: https://github.com/duduribeiro
@@ -137,3 +190,7 @@
137
190
  [@herwinw]: https://github.com/herwinw
138
191
  [@fsateler]: https://github.com/fsateler
139
192
  [@andrykonchin]: https://github.com/andrykonchin
193
+ [@fatkodima]: https://github.com/fatkodima
194
+ [@tsmmark]: https://github.com/tsmmark
195
+ [@cstyles]: https://github.com/cstyles
196
+ [@ghiculescu]: https://github.com/ghiculescu
data/CONTRIBUTING.md CHANGED
@@ -49,18 +49,18 @@ $ rubocop -V
49
49
  Here are a few examples:
50
50
 
51
51
  ```
52
- * [#716](https://github.com/rubocop-hq/rubocop-minitest/issues/716): Fixed a regression in the auto-correction logic of `MethodDefParentheses`. ([@bbatsov][])
52
+ * [#716](https://github.com/rubocop/rubocop-minitest/issues/716): Fixed a regression in the auto-correction logic of `MethodDefParentheses`. ([@bbatsov][])
53
53
  * New cop `ElseLayout` checks for odd arrangement of code in the `else` branch of a conditional expression. ([@bbatsov][])
54
54
  ```
55
55
 
56
56
  * Mark it up in [Markdown syntax][6].
57
57
  * The entry line should start with `* ` (an asterisk and a space).
58
- * If the change has a related GitHub issue (e.g. a bug fix for a reported issue), put a link to the issue as `[#123](https://github.com/rubocop-hq/rubocop-minitest/issues/123): `.
58
+ * If the change has a related GitHub issue (e.g. a bug fix for a reported issue), put a link to the issue as `[#123](https://github.com/rubocop/rubocop-minitest/issues/123): `.
59
59
  * Describe the brief of the change. The sentence should end with a punctuation.
60
60
  * At the end of the entry, add an implicit link to your GitHub user page as `([@username][])`.
61
61
  * If this is your first contribution to RuboCop project, add a link definition for the implicit link to the bottom of the changelog as `[@username]: https://github.com/username`.
62
62
 
63
- [1]: https://github.com/rubocop-hq/rubocop-minitest/issues
63
+ [1]: https://github.com/rubocop/rubocop-minitest/issues
64
64
  [2]: https://www.gun.io/blog/how-to-github-fork-branch-and-pull-request
65
65
  [3]: https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
66
66
  [4]: https://help.github.com/articles/about-pull-requests
data/Gemfile CHANGED
@@ -8,6 +8,6 @@ gemspec
8
8
 
9
9
  gem 'bump', require: false
10
10
  gem 'rake'
11
- gem 'rubocop', github: 'rubocop-hq/rubocop'
12
- gem 'rubocop-performance', '~> 1.5.0'
11
+ gem 'rubocop', github: 'rubocop/rubocop'
12
+ gem 'rubocop-performance', '~> 1.10.0'
13
13
  gem 'yard', '~> 0.9'
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2019-2020 Bozhidar Batsov, Jonas Arvidsson, Koichi ITO
3
+ Copyright (c) 2019-2021 Bozhidar Batsov, Jonas Arvidsson, Koichi ITO
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # RuboCop Minitest
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/rubocop-minitest.svg)](https://badge.fury.io/rb/rubocop-minitest)
4
- [![CircleCI](https://circleci.com/gh/rubocop-hq/rubocop-minitest.svg?style=svg)](https://circleci.com/gh/rubocop-hq/rubocop-minitest)
4
+ [![CircleCI](https://circleci.com/gh/rubocop/rubocop-minitest.svg?style=svg)](https://circleci.com/gh/rubocop/rubocop-minitest)
5
5
 
6
- A [RuboCop](https://github.com/rubocop-hq/rubocop) extension focused on enforcing Minitest best practices and coding conventions.
6
+ A [RuboCop](https://github.com/rubocop/rubocop) extension focused on enforcing Minitest best practices and coding conventions.
7
7
  The library is based on the guidelines outlined in the community [Minitest Style Guide](https://minitest.rubystyle.guide).
8
8
 
9
9
  ## Installation
@@ -62,7 +62,7 @@ end
62
62
 
63
63
  All cops are located under
64
64
  [`lib/rubocop/cop/minitest`](lib/rubocop/cop/minitest), and contain
65
- examples/documentation. The documentation is published [here](https://docs.rubocop.org/projects/minitest).
65
+ examples/documentation. The documentation is published [here](https://docs.rubocop.org/rubocop-minitest/).
66
66
 
67
67
  In your `.rubocop.yml`, you may treat the Minitest cops just like any other
68
68
  cop. For example:
@@ -75,7 +75,23 @@ Minitest/AssertNil:
75
75
 
76
76
  ## Documentation
77
77
 
78
- You can read a lot more about RuboCop Minitest in its [official docs](https://docs.rubocop.org/projects/minitest/).
78
+ You can read a lot more about RuboCop Minitest in its [official docs](https://docs.rubocop.org/rubocop-minitest/).
79
+
80
+ ## Readme Badge
81
+
82
+ If you use RuboCop Minitest in your project, you can include one of these badges in your readme to let people know that your code is written following the community Minitest Style Guide.
83
+
84
+ [![Minitest Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop/rubocop-minitest)
85
+
86
+ [![Minitest Style Guide](https://img.shields.io/badge/code_style-community-brightgreen.svg)](https://minitest.rubystyle.guide)
87
+
88
+ Here are the Markdown snippets for the two badges:
89
+
90
+ ``` markdown
91
+ [![Minitest Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop/rubocop-minitest)
92
+
93
+ [![Minitest Style Guide](https://img.shields.io/badge/code_style-community-brightgreen.svg)](https://minitest.rubystyle.guide)
94
+ ```
79
95
 
80
96
  ## Contributing
81
97
 
data/Rakefile CHANGED
@@ -15,6 +15,7 @@ end
15
15
 
16
16
  require 'rubocop/rake_task'
17
17
  require 'rake/testtask'
18
+ require_relative 'lib/rubocop/cop/generator'
18
19
 
19
20
  Rake::TestTask.new do |t|
20
21
  t.libs << 'test'
@@ -36,3 +37,31 @@ task default: %i[
36
37
  test
37
38
  internal_investigation
38
39
  ]
40
+
41
+ desc 'Generate a new cop template'
42
+ task :new_cop, [:cop] do |_task, args|
43
+ require 'rubocop'
44
+
45
+ cop_name = args.fetch(:cop) do
46
+ warn 'usage: bundle exec rake new_cop[Department/Name]'
47
+ exit!
48
+ end
49
+
50
+ github_user = `git config github.user`.chop
51
+ github_user = 'your_id' if github_user.empty?
52
+
53
+ generator = RuboCop::Cop::Generator.new(cop_name, github_user)
54
+
55
+ generator.write_source
56
+ generator.write_test
57
+ generator.inject_require(root_file_path: 'lib/rubocop/cop/minitest_cops.rb')
58
+ generator.inject_config(config_file_path: 'config/default.yml', version_added: bump_minor_version)
59
+
60
+ puts generator.todo
61
+ end
62
+
63
+ def bump_minor_version
64
+ major, minor, _patch = RuboCop::Minitest::Version::STRING.split('.')
65
+
66
+ "#{major}.#{minor.succ}"
67
+ end