rubocop-minitest 0.2.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +6 -0
- data/CHANGELOG.md +53 -5
- data/Gemfile +2 -1
- data/README.md +2 -1
- data/config/default.yml +71 -11
- data/lib/rubocop-minitest.rb +0 -3
- data/lib/rubocop/cop/minitest/assert_empty.rb +6 -5
- data/lib/rubocop/cop/minitest/assert_empty_literal.rb +36 -0
- data/lib/rubocop/cop/minitest/assert_equal.rb +57 -0
- data/lib/rubocop/cop/minitest/assert_includes.rb +7 -7
- data/lib/rubocop/cop/minitest/assert_instance_of.rb +60 -0
- data/lib/rubocop/cop/minitest/assert_nil.rb +2 -1
- data/lib/rubocop/cop/minitest/assert_respond_to.rb +59 -0
- data/lib/rubocop/cop/minitest/assert_truthy.rb +2 -2
- data/lib/rubocop/cop/minitest/refute_empty.rb +51 -0
- data/lib/rubocop/cop/minitest/refute_equal.rb +69 -0
- data/lib/rubocop/cop/minitest/refute_false.rb +46 -0
- data/lib/rubocop/cop/minitest/refute_includes.rb +60 -0
- data/lib/rubocop/cop/minitest/refute_instance_of.rb +60 -0
- data/lib/rubocop/cop/minitest/refute_nil.rb +2 -1
- data/lib/rubocop/cop/minitest/refute_respond_to.rb +59 -0
- data/lib/rubocop/cop/minitest_cops.rb +10 -0
- data/lib/rubocop/minitest/version.rb +1 -1
- data/manual/cops.md +10 -0
- data/manual/cops_minitest.md +264 -15
- data/relnotes/v0.1.0.md +7 -0
- data/relnotes/v0.2.0.md +9 -0
- data/relnotes/v0.2.1.md +5 -0
- data/relnotes/v0.3.0.md +16 -0
- data/relnotes/v0.4.0.md +14 -0
- data/relnotes/v0.4.1.md +5 -0
- data/relnotes/v0.5.0.md +5 -0
- data/tasks/cut_release.rake +60 -0
- metadata +22 -3
@@ -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.
|
4
|
+
version: 0.5.0
|
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-
|
13
|
+
date: 2019-11-24 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,10 +67,20 @@ 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
|
74
85
|
- lib/rubocop/minitest.rb
|
75
86
|
- lib/rubocop/minitest/inject.rb
|
@@ -81,8 +92,16 @@ files:
|
|
81
92
|
- manual/usage.md
|
82
93
|
- mkdocs.yml
|
83
94
|
- readthedocs.yml
|
95
|
+
- relnotes/v0.1.0.md
|
96
|
+
- relnotes/v0.2.0.md
|
97
|
+
- relnotes/v0.2.1.md
|
98
|
+
- relnotes/v0.3.0.md
|
99
|
+
- relnotes/v0.4.0.md
|
100
|
+
- relnotes/v0.4.1.md
|
101
|
+
- relnotes/v0.5.0.md
|
84
102
|
- rubocop-minitest.gemspec
|
85
103
|
- tasks/cops_documentation.rake
|
104
|
+
- tasks/cut_release.rake
|
86
105
|
homepage:
|
87
106
|
licenses:
|
88
107
|
- MIT
|
@@ -107,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
126
|
- !ruby/object:Gem::Version
|
108
127
|
version: '0'
|
109
128
|
requirements: []
|
110
|
-
rubygems_version: 3.0.
|
129
|
+
rubygems_version: 3.0.3
|
111
130
|
signing_key:
|
112
131
|
specification_version: 4
|
113
132
|
summary: Automatic Minitest code style checking tool.
|