Skip to content

Commit e56d645

Browse files
committed
Update standard gem to 1.1.5
1 parent 2ed2a63 commit e56d645

File tree

160 files changed

+2917
-260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+2917
-260
lines changed

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ source "https://rubygems.org"
22

33
gem "activesupport", require: false
44
gem "mry", "~> 0.52.0", require: false
5-
gem "parser", "~> 2.7.1"
5+
gem "parser", "~> 3.0.2"
66
gem "pry", require: false
77
gem "safe_yaml"
8-
gem "standard", "~> 0.6.0", require: false
8+
gem "standard", "~> 1.1.5", require: false
99

1010
group :test do
1111
gem "rake"

Gemfile.lock

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ GEM
77
minitest (~> 5.1)
88
tzinfo (~> 1.1)
99
zeitwerk (~> 2.2, >= 2.2.2)
10-
ast (2.4.1)
10+
ast (2.4.2)
1111
coderay (1.1.3)
1212
concurrent-ruby (1.1.7)
1313
diff-lcs (1.4.4)
@@ -17,16 +17,16 @@ GEM
1717
minitest (5.14.2)
1818
mry (0.52.0.0)
1919
rubocop (>= 0.41.0)
20-
parallel (1.19.2)
21-
parser (2.7.1.4)
20+
parallel (1.20.1)
21+
parser (3.0.2.0)
2222
ast (~> 2.4.1)
2323
pry (0.13.1)
2424
coderay (~> 1.1)
2525
method_source (~> 1.0)
2626
rainbow (3.0.0)
2727
rake (13.0.1)
28-
regexp_parser (1.7.1)
29-
rexml (3.2.4)
28+
regexp_parser (2.1.1)
29+
rexml (3.2.5)
3030
rspec (3.9.0)
3131
rspec-core (~> 3.9.0)
3232
rspec-expectations (~> 3.9.0)
@@ -40,28 +40,29 @@ GEM
4040
diff-lcs (>= 1.2.0, < 2.0)
4141
rspec-support (~> 3.9.0)
4242
rspec-support (3.9.3)
43-
rubocop (0.90.0)
43+
rubocop (1.18.3)
4444
parallel (~> 1.10)
45-
parser (>= 2.7.1.1)
45+
parser (>= 3.0.0.0)
4646
rainbow (>= 2.2.2, < 4.0)
47-
regexp_parser (>= 1.7)
47+
regexp_parser (>= 1.8, < 3.0)
4848
rexml
49-
rubocop-ast (>= 0.3.0, < 1.0)
49+
rubocop-ast (>= 1.7.0, < 2.0)
5050
ruby-progressbar (~> 1.7)
51-
unicode-display_width (>= 1.4.0, < 2.0)
52-
rubocop-ast (0.3.0)
53-
parser (>= 2.7.1.4)
54-
rubocop-performance (1.8.0)
55-
rubocop (>= 0.87.0)
56-
ruby-progressbar (1.10.1)
51+
unicode-display_width (>= 1.4.0, < 3.0)
52+
rubocop-ast (1.7.0)
53+
parser (>= 3.0.1.1)
54+
rubocop-performance (1.11.4)
55+
rubocop (>= 1.7.0, < 2.0)
56+
rubocop-ast (>= 0.4.0)
57+
ruby-progressbar (1.11.0)
5758
safe_yaml (1.0.5)
58-
standard (0.6.0)
59-
rubocop (~> 0.90)
60-
rubocop-performance (~> 1.8.0)
59+
standard (1.1.5)
60+
rubocop (= 1.18.3)
61+
rubocop-performance (= 1.11.4)
6162
thread_safe (0.3.6)
6263
tzinfo (1.2.7)
6364
thread_safe (~> 0.1)
64-
unicode-display_width (1.7.0)
65+
unicode-display_width (2.0.0)
6566
zeitwerk (2.4.0)
6667

6768
PLATFORMS
@@ -70,12 +71,12 @@ PLATFORMS
7071
DEPENDENCIES
7172
activesupport
7273
mry (~> 0.52.0)
73-
parser (~> 2.7.1)
74+
parser (~> 3.0.2)
7475
pry
7576
rake
7677
rspec
7778
safe_yaml
78-
standard (~> 0.6.0)
79+
standard (~> 1.1.5)
7980

8081
BUNDLED WITH
8182
2.1.4

config/contents/bundler/duplicated_gem.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,13 @@ A Gem's requirements should be listed only once in a Gemfile.
1919
end
2020

2121
# good
22-
gem 'rubocop', groups: [:development, :test]
22+
gem 'rubocop', groups: [:development, :test]
23+
24+
# good - conditional declaration
25+
if Dir.exist?(local)
26+
gem 'rubocop', path: local
27+
elsif ENV['RUBOCOP_VERSION'] == 'master'
28+
gem 'rubocop', git: 'https://github.com/rubocop/rubocop.git'
29+
else
30+
gem 'rubocop', '~> 0.90.0'
31+
end

config/contents/bundler/gem_comment.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1-
Add a comment describing each gem in your Gemfile.
1+
Each gem in the Gemfile should have a comment explaining
2+
its purpose in the project, or the reason for its version
3+
or source.
24

3-
Optionally, the "OnlyFor" configuration
5+
The optional "OnlyFor" configuration array
46
can be used to only register offenses when the gems
57
use certain options or have version specifiers.
6-
Add "version_specifiers" and/or the gem option names
7-
you want to check.
88

9-
A useful use-case is to enforce a comment when using
9+
When "version_specifiers" is included, a comment
10+
will be enforced if the gem has any version specifier.
11+
12+
When "restrictive_version_specifiers" is included, a comment
13+
will be enforced if the gem has a version specifier that
14+
holds back the version of the gem.
15+
16+
For any other value in the array, a comment will be enforced for
17+
a gem if an option by the same name is present.
18+
A useful use case is to enforce a comment when using
1019
options that change the source of a gem:
1120

1221
- `bitbucket`
@@ -16,7 +25,8 @@ options that change the source of a gem:
1625
- `source`
1726

1827
For a full list of options supported by bundler,
19-
you can check the https://bundler.io/man/gemfile.5.html[official documentation].
28+
see https://bundler.io/man/gemfile.5.html
29+
.
2030

2131
### Example: OnlyFor: [] (default)
2232
# bad
@@ -38,6 +48,18 @@ you can check the https://bundler.io/man/gemfile.5.html[official documentation].
3848
# Version 2.1 introduces breaking change baz
3949
gem 'foo', '< 2.1'
4050

51+
### Example: OnlyFor: ['restrictive_version_specifiers']
52+
# bad
53+
54+
gem 'foo', '< 2.1'
55+
56+
# good
57+
58+
gem 'foo', '>= 1.0'
59+
60+
# Version 2.1 introduces breaking change baz
61+
gem 'foo', '< 2.1'
62+
4163
### Example: OnlyFor: ['version_specifiers', 'github']
4264
# bad
4365

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
Enforce that Gem version specifications or a commit reference (branch,
2+
ref, or tag) are either required or forbidden.
3+
4+
### Example: EnforcedStyle: required (default)
5+
# bad
6+
gem 'rubocop'
7+
8+
# good
9+
gem 'rubocop', '~> 1.12'
10+
11+
# good
12+
gem 'rubocop', '>= 1.10.0'
13+
14+
# good
15+
gem 'rubocop', '>= 1.5.0', '< 1.10.0'
16+
17+
# good
18+
gem 'rubocop', branch: 'feature-branch'
19+
20+
# good
21+
gem 'rubocop', ref: '74b5bfbb2c4b6fd6cdbbc7254bd7084b36e0c85b'
22+
23+
# good
24+
gem 'rubocop', tag: 'v1.17.0'
25+
26+
### Example: EnforcedStyle: forbidden
27+
# good
28+
gem 'rubocop'
29+
30+
# bad
31+
gem 'rubocop', '~> 1.12'
32+
33+
# bad
34+
gem 'rubocop', '>= 1.10.0'
35+
36+
# bad
37+
gem 'rubocop', '>= 1.5.0', '< 1.10.0'
38+
39+
# bad
40+
gem 'rubocop', branch: 'feature-branch'
41+
42+
# bad
43+
gem 'rubocop', ref: '74b5bfbb2c4b6fd6cdbbc7254bd7084b36e0c85b'
44+
45+
# bad
46+
gem 'rubocop', tag: 'v1.17.0'
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
This cop checks that `date =` is not used in gemspec file.
2+
It is set automatically when the gem is packaged.
3+
4+
### Example:
5+
6+
# bad
7+
Gem::Specification.new do |spec|
8+
s.name = 'your_cool_gem_name'
9+
spec.date = Time.now.strftime('%Y-%m-%d')
10+
end
11+
12+
# good
13+
Gem::Specification.new do |spec|
14+
s.name = 'your_cool_gem_name'
15+
end

config/contents/gemspec/required_ruby_version.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@ required by gemspec.
3131
spec.required_ruby_version = '>= 2.5'
3232
end
3333

34-
# good
34+
# accepted but not recommended
3535
Gem::Specification.new do |spec|
3636
spec.required_ruby_version = ['>= 2.5.0', '< 2.7.0']
3737
end
3838

39-
# good
39+
# accepted but not recommended, since
40+
# Ruby does not really follow semantic versionning
4041
Gem::Specification.new do |spec|
4142
spec.required_ruby_version = '~> 2.5'
4243
end

config/contents/layout/argument_alignment.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,36 @@ definition are aligned.
55
# good
66

77
foo :bar,
8-
:baz
8+
:baz,
9+
key: value
910

1011
foo(
1112
:bar,
12-
:baz
13+
:baz,
14+
key: value
1315
)
1416

1517
# bad
1618

1719
foo :bar,
18-
:baz
20+
:baz,
21+
key: value
1922

2023
foo(
2124
:bar,
22-
:baz
25+
:baz,
26+
key: value
2327
)
2428

2529
### Example: EnforcedStyle: with_fixed_indentation
2630
# good
2731

2832
foo :bar,
29-
:baz
33+
:baz,
34+
key: value
3035

3136
# bad
3237

3338
foo :bar,
34-
:baz
39+
:baz,
40+
key: value
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
This cop checks whether the end keyword of `begin` is aligned properly.
2+
3+
Two modes are supported through the `EnforcedStyleAlignWith` configuration
4+
parameter. If it's set to `start_of_line` (which is the default), the
5+
`end` shall be aligned with the start of the line where the `begin`
6+
keyword is. If it's set to `begin`, the `end` shall be aligned with the
7+
`begin` keyword.
8+
9+
`Layout/EndAlignment` cop aligns with keywords (e.g. `if`, `while`, `case`)
10+
by default. On the other hand, `||= begin` that this cop targets tends to
11+
align with the start of the line, it defaults to `EnforcedStyleAlignWith: start_of_line`.
12+
These style can be configured by each cop.
13+
14+
### Example: EnforcedStyleAlignWith: start_of_line (default)
15+
# bad
16+
foo ||= begin
17+
do_something
18+
end
19+
20+
# good
21+
foo ||= begin
22+
do_something
23+
end
24+
25+
### Example: EnforcedStyleAlignWith: begin
26+
# bad
27+
foo ||= begin
28+
do_something
29+
end
30+
31+
# good
32+
foo ||= begin
33+
do_something
34+
end

0 commit comments

Comments
 (0)