rubocop-minitest 0.2.1 → 0.5.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 (38) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +7 -0
  3. data/.rubocop_todo.yml +5 -5
  4. data/CHANGELOG.md +44 -0
  5. data/Gemfile +6 -2
  6. data/README.md +2 -1
  7. data/config/default.yml +70 -10
  8. data/lib/rubocop-minitest.rb +0 -3
  9. data/lib/rubocop/cop/minitest/assert_empty.rb +11 -10
  10. data/lib/rubocop/cop/minitest/assert_empty_literal.rb +36 -0
  11. data/lib/rubocop/cop/minitest/assert_equal.rb +52 -0
  12. data/lib/rubocop/cop/minitest/assert_includes.rb +13 -12
  13. data/lib/rubocop/cop/minitest/assert_instance_of.rb +59 -0
  14. data/lib/rubocop/cop/minitest/assert_nil.rb +10 -4
  15. data/lib/rubocop/cop/minitest/assert_respond_to.rb +62 -0
  16. data/lib/rubocop/cop/minitest/assert_truthy.rb +10 -5
  17. data/lib/rubocop/cop/minitest/refute_empty.rb +51 -0
  18. data/lib/rubocop/cop/minitest/refute_equal.rb +68 -0
  19. data/lib/rubocop/cop/minitest/refute_false.rb +51 -0
  20. data/lib/rubocop/cop/minitest/refute_includes.rb +61 -0
  21. data/lib/rubocop/cop/minitest/refute_instance_of.rb +59 -0
  22. data/lib/rubocop/cop/minitest/refute_nil.rb +10 -4
  23. data/lib/rubocop/cop/minitest/refute_respond_to.rb +62 -0
  24. data/lib/rubocop/cop/minitest_cops.rb +11 -0
  25. data/lib/rubocop/cop/mixin/argument_range_helper.rb +31 -0
  26. data/lib/rubocop/minitest/version.rb +1 -1
  27. data/manual/cops.md +10 -0
  28. data/manual/cops_minitest.md +264 -15
  29. data/relnotes/v0.1.0.md +7 -0
  30. data/relnotes/v0.2.0.md +9 -0
  31. data/relnotes/v0.2.1.md +5 -0
  32. data/relnotes/v0.3.0.md +16 -0
  33. data/relnotes/v0.4.0.md +14 -0
  34. data/relnotes/v0.4.1.md +5 -0
  35. data/relnotes/v0.5.0.md +5 -0
  36. data/relnotes/v0.5.1.md +3 -0
  37. data/tasks/cut_release.rake +60 -0
  38. metadata +24 -3
@@ -0,0 +1,7 @@
1
+ ### New features
2
+
3
+ * Create RuboCop Minitest gem. ([@koic][])
4
+ * [#6](https://github.com/rubocop-hq/rubocop-minitest/pull/6): Add new `Minitest/AssertNil` cop. ([@duduribeiro ][])
5
+
6
+ [@koic]: https://github.com/koic
7
+ [@duduribeiro]: https://github.com/duduribeiro
@@ -0,0 +1,9 @@
1
+ ### New features
2
+
3
+ * [#11](https://github.com/rubocop-hq/rubocop-minitest/pull/11): Add new `Minitest/RefuteNil` cop. ([@tejasbubane ][])
4
+ * [#8](https://github.com/rubocop-hq/rubocop-minitest/pull/8): Add new `Minitest/AssertTruthy` cop. ([@abhaynikam ][])
5
+ * [#9](https://github.com/rubocop-hq/rubocop-minitest/pull/9): Add new `Minitest/AssertIncludes` cop. ([@abhaynikam ][])
6
+ * [#10](https://github.com/rubocop-hq/rubocop-minitest/pull/10): Add new `Minitest/AssertEmpty` cop. ([@abhaynikam ][])
7
+
8
+ [@tejasbubane]: https://github.com/tejasbubane
9
+ [@abhaynikam]: https://github.com/abhaynikam
@@ -0,0 +1,5 @@
1
+ ### Bug fixes
2
+
3
+ * [#13](https://github.com/rubocop-hq/rubocop-minitest/issues/13): Fix the execution target specified in `Include` parameter. ([@koic][])
4
+
5
+ [@koic]: https://github.com/koic
@@ -0,0 +1,16 @@
1
+ ## 0.3.0 (2019-10-13)
2
+
3
+ ### New features
4
+
5
+ * [#15](https://github.com/rubocop-hq/rubocop-minitest/pull/15): Add new `Minitest/RefuteIncludes` cop. ([@abhaynikam][])
6
+ * [#18](https://github.com/rubocop-hq/rubocop-minitest/pull/18): Add new `Minitest/RefuteFalse` cop. ([@duduribeiro][])
7
+ * [#20](https://github.com/rubocop-hq/rubocop-minitest/pull/20): Add new `Minitest/RefuteEmpty` cop. ([@abhaynikam][])
8
+ * [#21](https://github.com/rubocop-hq/rubocop-minitest/pull/21): Add new `Minitest/RefuteEqual` cop. ([@duduribeiro][])
9
+ * [#27](https://github.com/rubocop-hq/rubocop-minitest/pull/27): Add new `Minitest/AssertRespondTo` cop. ([@duduribeiro][])
10
+
11
+ ### Bug fixes
12
+
13
+ * [#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][])
14
+
15
+ [@abhaynikam]: https://github.com/abhaynikam
16
+ [@duduribeiro]: https://github.com/duduribeiro
@@ -0,0 +1,14 @@
1
+ ### New features
2
+
3
+ * [#29](https://github.com/rubocop-hq/rubocop-minitest/pull/29): Add new `Minitest/RefuteRespondTo` cop. ([@herwinw][])
4
+ * [#31](https://github.com/rubocop-hq/rubocop-minitest/pull/31): Add new `Minitest/AssertEqual` cop. ([@herwinw][])
5
+ * [#34](https://github.com/rubocop-hq/rubocop-minitest/pull/34): Add new `Minitest/AssertInstanceOf` cop. ([@abhaynikam][])
6
+ * [#35](https://github.com/rubocop-hq/rubocop-minitest/pull/35): Add new `Minitest/RefuteInstanceOf` cop. ([@abhaynikam][])
7
+
8
+ ### Bug fixes
9
+
10
+ * [#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][])
11
+
12
+ [@herwinw]: https://github.com/herwinw
13
+ [@abhaynikam]: https://github.com/abhaynikam
14
+ [@koic]: https://github.com/koic
@@ -0,0 +1,5 @@
1
+ ### Bug fixes
2
+
3
+ * [#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][])
4
+
5
+ [@koic]: https://github.com/koic
@@ -0,0 +1,5 @@
1
+ ### New features
2
+
3
+ * [#32](https://github.com/rubocop-hq/rubocop-minitest/issues/32): Add new `Minitest/AssertEmptyLiteral` cop. ([@tejasbubane][])
4
+
5
+ [@tejasbubane]: https://github.com/tejasbubane
@@ -0,0 +1,3 @@
1
+ * [#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][])
2
+
3
+ [@koic]: https://github.com/koic
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bump'
4
+
5
+ namespace :cut_release do
6
+ %w[major minor patch pre].each do |release_type|
7
+ desc "Cut a new #{release_type} release, create release notes " \
8
+ 'and update documents.'
9
+ task release_type do
10
+ run(release_type)
11
+ end
12
+ end
13
+
14
+ def add_header_to_changelog(version)
15
+ changelog = File.read('CHANGELOG.md')
16
+ head, tail = changelog.split("## master (unreleased)\n\n", 2)
17
+
18
+ File.open('CHANGELOG.md', 'w') do |f|
19
+ f << head
20
+ f << "## master (unreleased)\n\n"
21
+ f << "## #{version} (#{Time.now.strftime('%F')})\n\n"
22
+ f << tail
23
+ end
24
+ end
25
+
26
+ def create_release_notes(version)
27
+ release_notes = new_version_changes.strip
28
+ contributor_links = user_links(release_notes)
29
+
30
+ File.open("relnotes/v#{version}.md", 'w') do |file|
31
+ file << release_notes
32
+ file << "\n\n"
33
+ file << contributor_links
34
+ file << "\n"
35
+ end
36
+ end
37
+
38
+ def new_version_changes
39
+ changelog = File.read('CHANGELOG.md')
40
+ _, _, new_changes, _older_changes = changelog.split(/^## .*$/, 4)
41
+ new_changes
42
+ end
43
+
44
+ def user_links(text)
45
+ names = text.scan(/\[@(\S+)\]\[\]/).map(&:first).uniq
46
+ names.map { |name| "[@#{name}]: https://github.com/#{name}" }
47
+ .join("\n")
48
+ end
49
+
50
+ def run(release_type)
51
+ old_version = Bump::Bump.current
52
+ Bump::Bump.run(release_type, commit: false, bundle: false, tag: false)
53
+ new_version = Bump::Bump.current
54
+
55
+ add_header_to_changelog(new_version)
56
+ create_release_notes(new_version)
57
+
58
+ puts "Changed version from #{old_version} to #{new_version}."
59
+ end
60
+ end
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.2.1
4
+ version: 0.5.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: 2019-09-24 00:00:00.000000000 Z
13
+ date: 2019-12-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubocop
@@ -49,6 +49,7 @@ extensions: []
49
49
  extra_rdoc_files: []
50
50
  files:
51
51
  - ".circleci/config.yml"
52
+ - ".github/FUNDING.yml"
52
53
  - ".github/ISSUE_TEMPLATE/bug_report.md"
53
54
  - ".github/ISSUE_TEMPLATE/feature_request.md"
54
55
  - ".github/PULL_REQUEST_TEMPLATE.md"
@@ -66,11 +67,22 @@ files:
66
67
  - config/default.yml
67
68
  - lib/rubocop-minitest.rb
68
69
  - lib/rubocop/cop/minitest/assert_empty.rb
70
+ - lib/rubocop/cop/minitest/assert_empty_literal.rb
71
+ - lib/rubocop/cop/minitest/assert_equal.rb
69
72
  - lib/rubocop/cop/minitest/assert_includes.rb
73
+ - lib/rubocop/cop/minitest/assert_instance_of.rb
70
74
  - lib/rubocop/cop/minitest/assert_nil.rb
75
+ - lib/rubocop/cop/minitest/assert_respond_to.rb
71
76
  - lib/rubocop/cop/minitest/assert_truthy.rb
77
+ - lib/rubocop/cop/minitest/refute_empty.rb
78
+ - lib/rubocop/cop/minitest/refute_equal.rb
79
+ - lib/rubocop/cop/minitest/refute_false.rb
80
+ - lib/rubocop/cop/minitest/refute_includes.rb
81
+ - lib/rubocop/cop/minitest/refute_instance_of.rb
72
82
  - lib/rubocop/cop/minitest/refute_nil.rb
83
+ - lib/rubocop/cop/minitest/refute_respond_to.rb
73
84
  - lib/rubocop/cop/minitest_cops.rb
85
+ - lib/rubocop/cop/mixin/argument_range_helper.rb
74
86
  - lib/rubocop/minitest.rb
75
87
  - lib/rubocop/minitest/inject.rb
76
88
  - lib/rubocop/minitest/version.rb
@@ -81,8 +93,17 @@ files:
81
93
  - manual/usage.md
82
94
  - mkdocs.yml
83
95
  - readthedocs.yml
96
+ - relnotes/v0.1.0.md
97
+ - relnotes/v0.2.0.md
98
+ - relnotes/v0.2.1.md
99
+ - relnotes/v0.3.0.md
100
+ - relnotes/v0.4.0.md
101
+ - relnotes/v0.4.1.md
102
+ - relnotes/v0.5.0.md
103
+ - relnotes/v0.5.1.md
84
104
  - rubocop-minitest.gemspec
85
105
  - tasks/cops_documentation.rake
106
+ - tasks/cut_release.rake
86
107
  homepage:
87
108
  licenses:
88
109
  - MIT
@@ -107,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
128
  - !ruby/object:Gem::Version
108
129
  version: '0'
109
130
  requirements: []
110
- rubygems_version: 3.0.6
131
+ rubygems_version: 3.1.2
111
132
  signing_key:
112
133
  specification_version: 4
113
134
  summary: Automatic Minitest code style checking tool.