Skip to content

Commit 856c49e

Browse files
Merge pull request #4 from milesstanfield/standard-1-37-0
standard-1-37-0
2 parents 2974e1e + bf30535 commit 856c49e

File tree

536 files changed

+6009
-1314
lines changed

Some content is hidden

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

536 files changed

+6009
-1314
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN adduser -u 9000 -g 9000 -D app
99
COPY Gemfile Gemfile.lock /usr/src/app/
1010

1111
RUN apk add --update build-base && \
12-
gem install bundler && \
12+
gem install bundler -v 2.4.22 && \
1313
bundle install --quiet -j 4 --without=test && \
1414
chown -R app:app /usr/local/bundle && \
1515
rm -fr ~/.gem ~/.bundle ~/.wh..gem && \

Gemfile

+2-2
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", "~> 3.0.2"
5+
gem "parser", "~> 3.3.0"
66
gem "pry", require: false
77
gem "safe_yaml"
8-
gem "standard", "~> 1.4", require: false
8+
gem "standard", "1.37.0", require: false
99

1010
group :test do
1111
gem "rake"

Gemfile.lock

+38-22
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,25 @@ GEM
1313
diff-lcs (1.4.4)
1414
i18n (1.8.10)
1515
concurrent-ruby (~> 1.0)
16+
json (2.8.2)
17+
language_server-protocol (3.17.0.3)
18+
lint_roller (1.1.0)
1619
method_source (1.0.0)
1720
minitest (5.14.4)
1821
mry (0.52.0.0)
1922
rubocop (>= 0.41.0)
20-
parallel (1.21.0)
21-
parser (3.0.3.1)
23+
parallel (1.26.3)
24+
parser (3.3.6.0)
2225
ast (~> 2.4.1)
26+
racc
2327
pry (0.14.1)
2428
coderay (~> 1.1)
2529
method_source (~> 1.0)
26-
rainbow (3.0.0)
30+
racc (1.8.1)
31+
rainbow (3.1.1)
2732
rake (13.0.6)
28-
regexp_parser (2.1.1)
29-
rexml (3.2.5)
33+
regexp_parser (2.9.2)
34+
rexml (3.3.9)
3035
rspec (3.10.0)
3136
rspec-core (~> 3.10.0)
3237
rspec-expectations (~> 3.10.0)
@@ -40,28 +45,39 @@ GEM
4045
diff-lcs (>= 1.2.0, < 2.0)
4146
rspec-support (~> 3.10.0)
4247
rspec-support (3.10.2)
43-
rubocop (1.22.3)
48+
rubocop (1.64.1)
49+
json (~> 2.3)
50+
language_server-protocol (>= 3.17.0)
4451
parallel (~> 1.10)
45-
parser (>= 3.0.0.0)
52+
parser (>= 3.3.0.2)
4653
rainbow (>= 2.2.2, < 4.0)
4754
regexp_parser (>= 1.8, < 3.0)
48-
rexml
49-
rubocop-ast (>= 1.12.0, < 2.0)
55+
rexml (>= 3.2.5, < 4.0)
56+
rubocop-ast (>= 1.31.1, < 2.0)
5057
ruby-progressbar (~> 1.7)
51-
unicode-display_width (>= 1.4.0, < 3.0)
52-
rubocop-ast (1.13.0)
53-
parser (>= 3.0.1.1)
54-
rubocop-performance (1.11.5)
55-
rubocop (>= 1.7.0, < 2.0)
56-
rubocop-ast (>= 0.4.0)
57-
ruby-progressbar (1.11.0)
58+
unicode-display_width (>= 2.4.0, < 3.0)
59+
rubocop-ast (1.36.1)
60+
parser (>= 3.3.1.0)
61+
rubocop-performance (1.21.1)
62+
rubocop (>= 1.48.1, < 2.0)
63+
rubocop-ast (>= 1.31.1, < 2.0)
64+
ruby-progressbar (1.13.0)
5865
safe_yaml (1.0.5)
59-
standard (1.4.0)
60-
rubocop (= 1.22.3)
61-
rubocop-performance (= 1.11.5)
66+
standard (1.37.0)
67+
language_server-protocol (~> 3.17.0.2)
68+
lint_roller (~> 1.0)
69+
rubocop (~> 1.64.0)
70+
standard-custom (~> 1.0.0)
71+
standard-performance (~> 1.4)
72+
standard-custom (1.0.2)
73+
lint_roller (~> 1.0)
74+
rubocop (~> 1.50)
75+
standard-performance (1.4.0)
76+
lint_roller (~> 1.1)
77+
rubocop-performance (~> 1.21.0)
6278
tzinfo (2.0.4)
6379
concurrent-ruby (~> 1.0)
64-
unicode-display_width (2.1.0)
80+
unicode-display_width (2.6.0)
6581
zeitwerk (2.4.2)
6682

6783
PLATFORMS
@@ -70,12 +86,12 @@ PLATFORMS
7086
DEPENDENCIES
7187
activesupport
7288
mry (~> 0.52.0)
73-
parser (~> 3.0.2)
89+
parser (~> 3.3.0)
7490
pry
7591
rake
7692
rspec
7793
safe_yaml
78-
standard (~> 1.4)
94+
standard (= 1.37.0)
7995

8096
BUNDLED WITH
8197
2.1.4

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ You can find some basic setup instructions and links to the Standard OSS project
1111
### Installation
1212

1313
1. If you haven't already, [install the Code Climate CLI](https://github.com/codeclimate/codeclimate).
14-
2. Add the engine and enable it in your `.codeclimate.yml` file.
14+
2. Enable the engine by adding the following under `plugins` in your `.codeclimate.yaml`:
15+
```yaml
16+
plugins:
17+
standard:
18+
enabled: true
19+
```
1520
3. You're ready to analyze! Browse into your project's folder and run `codeclimate analyze`.
1621

1722
### Need help?

config/contents/bundler/duplicated_gem.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
A Gem's requirements should be listed only once in a Gemfile.
2+
23
### Example:
34
# bad
45
gem 'rubocop'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
A Gem group, or a set of groups, should be listed only once in a Gemfile.
2+
3+
For example, if the values of `source`, `git`, `platforms`, or `path`
4+
surrounding `group` are different, no offense will be registered:
5+
6+
[source,ruby]
7+
-----
8+
platforms :ruby do
9+
group :default do
10+
gem 'openssl'
11+
end
12+
end
13+
14+
platforms :jruby do
15+
group :default do
16+
gem 'jruby-openssl'
17+
end
18+
end
19+
-----
20+
21+
### Example:
22+
# bad
23+
group :development do
24+
gem 'rubocop'
25+
end
26+
27+
group :development do
28+
gem 'rubocop-rails'
29+
end
30+
31+
# bad (same set of groups declared twice)
32+
group :development, :test do
33+
gem 'rubocop'
34+
end
35+
36+
group :test, :development do
37+
gem 'rspec'
38+
end
39+
40+
# good
41+
group :development do
42+
gem 'rubocop'
43+
end
44+
45+
group :development, :test do
46+
gem 'rspec'
47+
end
48+
49+
# good
50+
gem 'rubocop', groups: [:development, :test]
51+
gem 'rspec', groups: [:development, :test]
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Verifies that a project contains Gemfile or gems.rb file and correct
2+
associated lock file based on the configuration.
3+
4+
### Example: EnforcedStyle: Gemfile (default)
5+
# bad
6+
Project contains gems.rb and gems.locked files
7+
8+
# bad
9+
Project contains Gemfile and gems.locked file
10+
11+
# good
12+
Project contains Gemfile and Gemfile.lock
13+
14+
### Example: EnforcedStyle: gems.rb
15+
# bad
16+
Project contains Gemfile and Gemfile.lock files
17+
18+
# bad
19+
Project contains gems.rb and Gemfile.lock file
20+
21+
# good
22+
Project contains gems.rb and gems.locked files
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
The symbol argument `:gemcutter`, `:rubygems`, and `:rubyforge`
2-
are deprecated. So please change your source to URL string that
3-
'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
1+
Passing symbol arguments to `source` (e.g. `source :rubygems`) is
2+
deprecated because they default to using HTTP requests. Instead, specify
3+
`'https://rubygems.org'` if possible, or `'http://rubygems.org'` if not.
44

5-
This autocorrect will replace these symbols with 'https://rubygems.org'.
6-
Because it is secure, HTTPS request is strongly recommended. And in
7-
most use cases HTTPS will be fine.
5+
When autocorrecting, this cop will replace symbol arguments with
6+
`'https://rubygems.org'`.
87

9-
However, it don't replace all `sources` of `http://` with `https://`.
10-
For example, when specifying an internal gem server using HTTP on the
11-
intranet, a use case where HTTPS cannot be specified was considered.
12-
Consider using HTTP only if you cannot use HTTPS.
8+
This cop will not replace existing sources that use `http://`. This may
9+
be necessary where HTTPS is not available. For example, where using an
10+
internal gem server via an intranet, or where HTTPS is prohibited.
11+
However, you should strongly prefer `https://` where possible, as it is
12+
more secure.
13+
14+
If you don't allow `http://`, please set `false` to `AllowHttpProtocol`.
15+
This option is `true` by default for safe autocorrection.
1316

1417
### Example:
1518
# bad
@@ -19,4 +22,13 @@ Consider using HTTP only if you cannot use HTTPS.
1922

2023
# good
2124
source 'https://rubygems.org' # strongly recommended
22-
source 'http://rubygems.org'
25+
26+
### Example: AllowHttpProtocol: true (default)
27+
28+
# good
29+
source 'http://rubygems.org' # use only if HTTPS is unavailable
30+
31+
### Example: AllowHttpProtocol: false
32+
33+
# bad
34+
source 'http://rubygems.org'

config/contents/bundler/ordered_gems.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@ Gems should be alphabetically sorted within groups.
1414

1515
gem 'rspec'
1616

17-
# good only if TreatCommentsAsGroupSeparators is true
17+
### Example: TreatCommentsAsGroupSeparators: true (default)
18+
# good
19+
# For code quality
20+
gem 'rubocop'
21+
# For tests
22+
gem 'rspec'
23+
24+
### Example: TreatCommentsAsGroupSeparators: false
25+
# bad
1826
# For code quality
1927
gem 'rubocop'
2028
# For tests

config/contents/gemspec/date_assignment.md

-15
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
Enforce that gem dependency version specifications or a commit reference (branch,
2+
ref, or tag) are either required or forbidden.
3+
4+
### Example: EnforcedStyle: required (default)
5+
6+
# bad
7+
Gem::Specification.new do |spec|
8+
spec.add_dependency 'parser'
9+
end
10+
11+
# bad
12+
Gem::Specification.new do |spec|
13+
spec.add_development_dependency 'parser'
14+
end
15+
16+
# good
17+
Gem::Specification.new do |spec|
18+
spec.add_dependency 'parser', '>= 2.3.3.1', '< 3.0'
19+
end
20+
21+
# good
22+
Gem::Specification.new do |spec|
23+
spec.add_development_dependency 'parser', '>= 2.3.3.1', '< 3.0'
24+
end
25+
26+
### Example: EnforcedStyle: forbidden
27+
28+
# bad
29+
Gem::Specification.new do |spec|
30+
spec.add_dependency 'parser', '>= 2.3.3.1', '< 3.0'
31+
end
32+
33+
# bad
34+
Gem::Specification.new do |spec|
35+
spec.add_development_dependency 'parser', '>= 2.3.3.1', '< 3.0'
36+
end
37+
38+
# good
39+
Gem::Specification.new do |spec|
40+
spec.add_dependency 'parser'
41+
end
42+
43+
# good
44+
Gem::Specification.new do |spec|
45+
spec.add_development_dependency 'parser'
46+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Checks that deprecated attributes are not set in a gemspec file.
2+
Removing deprecated attributes allows the user to receive smaller packed gems.
3+
4+
### Example:
5+
6+
# bad
7+
Gem::Specification.new do |spec|
8+
spec.name = 'your_cool_gem_name'
9+
spec.test_files = Dir.glob('test/**/*')
10+
end
11+
12+
# bad
13+
Gem::Specification.new do |spec|
14+
spec.name = 'your_cool_gem_name'
15+
spec.test_files += Dir.glob('test/**/*')
16+
end
17+
18+
# good
19+
Gem::Specification.new do |spec|
20+
spec.name = 'your_cool_gem_name'
21+
end

0 commit comments

Comments
 (0)