rubocop-ruby2_4 1.0.3 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +5 -0
- data/CHANGELOG.md +40 -8
- data/CONTRIBUTING.md +25 -11
- data/LICENSE.txt +1 -1
- data/README.md +272 -128
- data/SECURITY.md +5 -4
- data/lib/rubocop/ruby2_4/railtie.rb +14 -0
- data/lib/rubocop/ruby2_4/rakelib/rubocop_gradual.rake +11 -0
- data/lib/rubocop/ruby2_4/tasks.rake +4 -0
- data/lib/rubocop/ruby2_4/version.rb +3 -1
- data/lib/rubocop/ruby2_4.rb +14 -0
- data/rubocop-lts/rails.yml +11 -0
- data/rubocop-lts/rails_rspec.yml +6 -0
- data/rubocop-lts/rspec.yml +9 -0
- data/rubocop-lts/ruby.yml +43 -0
- data/rubocop-lts/ruby_rspec.yml +6 -0
- data/rubocop-lts/rubygem.yml +6 -0
- data/rubocop-lts/rubygem_rspec.yml +4 -0
- data/rubocop-lts/strict/rails.yml +22 -0
- data/rubocop-lts/strict/rspec.yml +14 -0
- data/rubocop-lts/strict/ruby.yml +14 -0
- data/rubocop.yml +15 -3
- data/sig/rubocop/ruby2_4.rbs +4 -2
- data.tar.gz.sig +0 -0
- metadata +193 -33
- metadata.gz.sig +0 -0
- data/spec/config/rspec/rspec_core.rb +0 -13
- data/spec/rubocop/ruby2_4_spec.rb +0 -7
- data/spec/spec_helper.rb +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c468f09e6df99fc37cc57f608a10f3f55bcef4cfb1e61bab19cd67bb80a4d56
|
4
|
+
data.tar.gz: '09e28dd0efa458d3a62fad464a2df8c4204f465c01ed2f62f09afea6fc87a08f'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f24a2729c08b3b87b26c60df27723e465cbaaf8e87ab7d34316ad57e5a173a45bf6028cf2371da17d7df0c353b0e621bc952997603e583d90a95c8bff629a68
|
7
|
+
data.tar.gz: 474a53e75660080753b1eb26d2dbdbd875f0c016036065ac5a024b18cb741ba458ddf2827b0c1843c242c5c8d6bf6dc85563f0b721401b79c15d00d467b432f3
|
checksums.yaml.gz.sig
ADDED
data/CHANGELOG.md
CHANGED
@@ -6,32 +6,64 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
### Added
|
9
|
-
|
10
9
|
### Changed
|
10
|
+
### Fixed
|
11
|
+
### Removed
|
11
12
|
|
13
|
+
## [2.0.2] 2023-05-21
|
12
14
|
### Fixed
|
15
|
+
- Ship rakelib/**/*.rake tasks
|
13
16
|
|
17
|
+
## [2.0.1] 2023-05-18
|
18
|
+
### Fixed
|
19
|
+
- Fix rake_tasks hook on Railtie
|
20
|
+
|
21
|
+
## [2.0.0] 2023-05-17 [YANKED]
|
22
|
+
### Added
|
23
|
+
- Configs for:
|
24
|
+
- rubocop
|
25
|
+
- rubocop-gradual
|
26
|
+
- rubocop-md
|
27
|
+
- rubocop-rake
|
28
|
+
- rubocop-shopify
|
29
|
+
- rubocop-thread_safety
|
30
|
+
- standard
|
31
|
+
- standard-performance
|
32
|
+
- standard-custom
|
33
|
+
- standard-rubocop-lts
|
34
|
+
- And optionally, if you are using RSpec:
|
35
|
+
- rubocop-rspec
|
36
|
+
- And optionally, if you are building a RubyGem:
|
37
|
+
- rubocop-packaging
|
38
|
+
- And optionally, if you are building a Rails app:
|
39
|
+
- betterlint
|
40
|
+
- standard-rails
|
41
|
+
- version_gem
|
14
42
|
### Removed
|
43
|
+
- Support for Ruby <= 2.6. Minimum Ruby Version is now 2.7
|
15
44
|
|
16
45
|
## [1.0.3] 2022-05-23
|
17
46
|
### Added
|
18
|
-
|
19
|
-
|
20
|
-
|
47
|
+
- Rubocop => RuboCop typo repair
|
48
|
+
- Ruby Version Support Matrix
|
49
|
+
- Improved documentation
|
21
50
|
|
22
51
|
## [1.0.2] 2022-05-03
|
23
52
|
### Fixed
|
24
|
-
|
53
|
+
- Added missing rubocop.yml for inherit_gem directive
|
25
54
|
|
26
55
|
## [1.0.1] 2022-05-02
|
27
56
|
### Added
|
28
|
-
|
57
|
+
- Documentation
|
29
58
|
|
30
59
|
## [1.0.0] 2022-05-01
|
31
60
|
### Added
|
32
|
-
|
61
|
+
- Initial release
|
33
62
|
|
34
|
-
[Unreleased]: https://github.com/rubocop-lts/rubocop-ruby2_4/compare/
|
63
|
+
[Unreleased]: https://github.com/rubocop-lts/rubocop-ruby2_4/compare/v2.0.2...HEAD
|
64
|
+
[2.0.2]: https://github.com/rubocop-lts/rubocop-ruby2_4/compare/v2.0.1...v2.0.2
|
65
|
+
[2.0.1]: https://github.com/rubocop-lts/rubocop-ruby2_4/compare/v2.0.0...v2.0.1
|
66
|
+
[2.0.0]: https://github.com/rubocop-lts/rubocop-ruby2_4/compare/v1.0.3...v2.0.0
|
35
67
|
[1.0.3]: https://github.com/rubocop-lts/rubocop-ruby2_4/compare/v1.0.2...v1.0.3
|
36
68
|
[1.0.2]: https://github.com/rubocop-lts/rubocop-ruby2_4/compare/v1.0.1...v1.0.2
|
37
69
|
[1.0.1]: https://github.com/rubocop-lts/rubocop-ruby2_4/compare/v1.0.0...v1.0.1
|
data/CONTRIBUTING.md
CHANGED
@@ -1,25 +1,39 @@
|
|
1
1
|
## Contributing
|
2
2
|
|
3
|
-
Bug reports and pull requests are welcome on
|
3
|
+
Bug reports and pull requests are welcome on GitLab at [https://gitlab.com/rubocop-lts/rubocop-ruby2_4][🚎src-main]
|
4
4
|
. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to
|
5
5
|
the [code of conduct][conduct].
|
6
6
|
|
7
|
-
To submit a patch, please fork the project and create a patch with tests. Once you're happy with it send a pull request
|
7
|
+
To submit a patch, please fork the project and create a patch with tests. Once you're happy with it send a pull request
|
8
|
+
and post a message to the [gitter chat][🏘chat].
|
8
9
|
|
9
|
-
##
|
10
|
-
|
11
|
-
[![Contributors](https://contrib.rocks/image?repo=rubocop-lts/rubocop-ruby2_4)][contributors]
|
10
|
+
## Release
|
12
11
|
|
13
|
-
|
12
|
+
To release a new version:
|
14
13
|
|
15
|
-
|
14
|
+
1. Run `bin/setup && bin/rake` as a tests, coverage, & linting sanity check.
|
15
|
+
2. update the version number in `version.rb`
|
16
|
+
3. Run `bin/setup && bin/rake` again as a secondary check, and to update `Gemfile.lock`.
|
17
|
+
4. run `bundle exec rake build:checksum`
|
18
|
+
5. move the built gem to project root
|
19
|
+
6. run `bin/checksum` to create the missing SHA256 checksum
|
20
|
+
7. move the built gem back to `pkg/`
|
21
|
+
8. commit the changes
|
22
|
+
9. run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org][rubygems].
|
16
23
|
|
17
|
-
|
24
|
+
NOTE: You will need to have a public key in `certs/`, and list your cert in the
|
25
|
+
`gemspec`, in order to sign the new release.
|
26
|
+
See: [RubyGems Security Guide][rubygems-security-guide]
|
18
27
|
|
19
|
-
|
28
|
+
## Contributors
|
20
29
|
|
21
|
-
|
30
|
+
See: [https://gitlab.com/rubocop-lts/rubocop-ruby2_4/-/graphs/main][🖐contributors]
|
22
31
|
|
23
32
|
[comment]: <> (Following links are used by README, CONTRIBUTING, Homepage)
|
24
33
|
|
25
|
-
[
|
34
|
+
[🤝conduct]: https://gitlab.com/rubocop-lts/rubocop-ruby2_4/-/blob/main/CODE_OF_CONDUCT.md
|
35
|
+
[🖐contributors]: https://gitlab.com/rubocop-lts/rubocop-ruby2_4/-/graphs/main
|
36
|
+
[🚎src-main]: https://gitlab.com/rubocop-lts/rubocop-ruby2_4/-/tree/main
|
37
|
+
[🏘chat]: https://gitter.im/rubocop-lts/community
|
38
|
+
[rubygems-security-guide]: https://guides.rubygems.org/security/#building-gems
|
39
|
+
[rubygems]: https://rubygems.org
|
data/LICENSE.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2022 Peter Boling
|
3
|
+
Copyright (c) 2022 - 2023 Peter H. Boling of https://railsbling.com
|
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
@@ -16,18 +16,106 @@
|
|
16
16
|
</a>
|
17
17
|
</p>
|
18
18
|
|
19
|
-
|
19
|
+
---
|
20
|
+
|
21
|
+
NOTE: You might be interested in [`rubocop-lts`][rlts] which sits as a higher level than this gem, and can keep pace with whatever version of Ruby you happen to be on.
|
22
|
+
|
23
|
+
| Gem Name | Version | Downloads | CI | Activity |
|
24
|
+
|-------------------------------|-------------------------------------|----------------------------------------------------------------------|-----------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|
|
25
|
+
| [`rubocop-lts`][⛳️lts-gh] | [![Gem Version][⛳️lts-vi]][⛳️lts-g] | [![Total DL][🖇️lts-dti]][⛳️lts-g] [![DL Rank][🏘️lts-rti]][⛳️lts-g] | [![Current][🚎lts-cwfi]][🚎lts-cwf] | [![Open Issues][📗lts-ioi]][📗lts-io] [![Closed Issues][🚀lts-ici]][🚀lts-ic] [![Open PRs][💄lts-poi]][💄lts-po] [![Closed PRs][👽lts-pci]][👽lts-pc] |
|
26
|
+
| [`rubocop-ruby2_4`][⛳️ini-gh] | [![Gem Version][⛳️ini-vi]][⛳️ini-g] | [![Total DL][🖇️ini-dti]][⛳️ini-g] [![DL Rank][🏘️ini-rti]][⛳️ini-g] | [![Current][🚎ini-cwfi]][🚎ini-cwf] [![Heads][🖐ini-hwfi]][🖐ini-hwf] | [![Open Issues][📗ini-ioi]][📗ini-io] [![Closed Issues][🚀ini-ici]][🚀ini-ic] [![Open PRs][💄ini-poi]][💄ini-po] [![Closed PRs][👽ini-pci]][👽ini-pc] |
|
27
|
+
|
28
|
+
<!-- columnar badge #s for Project Health table:
|
29
|
+
⛳️
|
30
|
+
🖇
|
31
|
+
🏘
|
32
|
+
🚎
|
33
|
+
🖐
|
34
|
+
🧮
|
35
|
+
📗
|
36
|
+
🚀
|
37
|
+
💄
|
38
|
+
👽
|
39
|
+
-->
|
40
|
+
|
41
|
+
[⛳️lts-vi]: http://img.shields.io/gem/v/rubocop-lts.svg
|
42
|
+
[🖇️lts-dti]: https://img.shields.io/gem/dt/rubocop-lts.svg
|
43
|
+
[🏘️lts-rti]: https://img.shields.io/gem/rt/rubocop-lts.svg
|
44
|
+
[🚎lts-cwf]: https://github.com/rubocop-lts/rubocop-lts/actions/workflows/current.yml
|
45
|
+
[🚎lts-cwfi]: https://github.com/rubocop-lts/rubocop-lts/actions/workflows/current.yml/badge.svg
|
46
|
+
[🖐lts-hwf]: https://github.com/rubocop-lts/rubocop-lts/actions/workflows/heads.yml
|
47
|
+
[🖐lts-hwfi]: https://github.com/rubocop-lts/rubocop-lts/actions/workflows/heads.yml/badge.svg
|
48
|
+
[🧮lts-lwf]: https://github.com/rubocop-lts/rubocop-lts/actions/workflows/legacy.yml
|
49
|
+
[🧮lts-lwfi]: https://github.com/rubocop-lts/rubocop-lts/actions/workflows/legacy.yml/badge.svg
|
50
|
+
[📗lts-io]: https://github.com/rubocop-lts/rubocop-lts/issues
|
51
|
+
[📗lts-ioi]: https://img.shields.io/github/issues-raw/rubocop-lts/rubocop-lts
|
52
|
+
[🚀lts-ic]: https://github.com/rubocop-lts/rubocop-lts/issues?q=is%3Aissue+is%3Aclosed
|
53
|
+
[🚀lts-ici]: https://img.shields.io/github/issues-closed-raw/rubocop-lts/rubocop-lts
|
54
|
+
[💄lts-po]: https://github.com/rubocop-lts/rubocop-lts/pulls
|
55
|
+
[💄lts-poi]: https://img.shields.io/github/issues-pr/rubocop-lts/rubocop-lts
|
56
|
+
[👽lts-pc]: https://github.com/rubocop-lts/rubocop-lts/pulls?q=is%3Apr+is%3Aclosed
|
57
|
+
[👽lts-pci]: https://img.shields.io/github/issues-pr-closed/rubocop-lts/rubocop-lts
|
58
|
+
[⛳️lts-g]: https://rubygems.org/gems/rubocop-lts
|
59
|
+
[⛳️lts-gh]: https://github.com/rubocop-lts/rubocop-lts
|
60
|
+
|
61
|
+
[⛳️ini-vi]: http://img.shields.io/gem/v/rubocop-ruby2_4.svg
|
62
|
+
[🖇️ini-dti]: https://img.shields.io/gem/dt/rubocop-ruby2_4.svg
|
63
|
+
[🏘️ini-rti]: https://img.shields.io/gem/rt/rubocop-ruby2_4.svg
|
64
|
+
[🚎ini-cwf]: https://github.com/rubocop-lts/rubocop-ruby2_4/actions/workflows/current.yml
|
65
|
+
[🚎ini-cwfi]: https://github.com/rubocop-lts/rubocop-ruby2_4/actions/workflows/current.yml/badge.svg
|
66
|
+
[🖐ini-hwf]: https://github.com/rubocop-lts/rubocop-ruby2_4/actions/workflows/heads.yml
|
67
|
+
[🖐ini-hwfi]: https://github.com/rubocop-lts/rubocop-ruby2_4/actions/workflows/heads.yml/badge.svg
|
68
|
+
[🧮ini-lwf]: https://github.com/rubocop-lts/rubocop-ruby2_4/actions/workflows/legacy.yml
|
69
|
+
[🧮ini-lwfi]: https://github.com/rubocop-lts/rubocop-ruby2_4/actions/workflows/legacy.yml/badge.svg
|
70
|
+
[📗ini-io]: https://github.com/rubocop-lts/rubocop-ruby2_4/issues
|
71
|
+
[📗ini-ioi]: https://img.shields.io/github/issues-raw/rubocop-lts/rubocop-ruby2_4
|
72
|
+
[🚀ini-ic]: https://github.com/rubocop-lts/rubocop-ruby2_4/issues?q=is%3Aissue+is%3Aclosed
|
73
|
+
[🚀ini-ici]: https://img.shields.io/github/issues-closed-raw/rubocop-lts/rubocop-ruby2_4
|
74
|
+
[💄ini-po]: https://github.com/rubocop-lts/rubocop-ruby2_4/pulls
|
75
|
+
[💄ini-poi]: https://img.shields.io/github/issues-pr/rubocop-lts/rubocop-ruby2_4
|
76
|
+
[👽ini-pc]: https://github.com/rubocop-lts/rubocop-ruby2_4/pulls?q=is%3Apr+is%3Aclosed
|
77
|
+
[👽ini-pci]: https://img.shields.io/github/issues-pr-closed/rubocop-lts/rubocop-ruby2_4
|
78
|
+
[⛳️ini-g]: https://rubygems.org/gems/rubocop-ruby2_4
|
79
|
+
[⛳️ini-gh]: https://github.com/rubocop-lts/rubocop-ruby2_4
|
80
|
+
|
81
|
+
# 🦾 Rubocop::Ruby24
|
20
82
|
|
21
83
|
See the intro [blog post](https://dev.to/pboling/rubocop-ruby-matrix-gems-nj)!
|
22
84
|
|
23
|
-
This gem
|
85
|
+
This gem configures many gems for you:
|
86
|
+
|
87
|
+
- rubocop
|
88
|
+
- rubocop-gradual
|
89
|
+
- rubocop-md
|
90
|
+
- rubocop-rake
|
91
|
+
- rubocop-shopify
|
92
|
+
- rubocop-thread_safety
|
93
|
+
- standard
|
94
|
+
- standard-performance (incl. rubocop-performance)
|
95
|
+
- standard-custom
|
96
|
+
- standard-rubocop-lts (ruby version-specific rules)
|
97
|
+
|
98
|
+
And optionally, if you are using RSpec:
|
99
|
+
|
100
|
+
- rubocop-rspec
|
101
|
+
|
102
|
+
And optionally, if you are building a RubyGem:
|
103
|
+
|
104
|
+
- rubocop-packaging
|
105
|
+
|
106
|
+
And optionally, if you are building a Rails app:
|
107
|
+
|
108
|
+
- standard-rails (incl. rubocop-rails)
|
109
|
+
- betterlint
|
24
110
|
|
25
111
|
Awareness of `rubocop`'s lack of [SemVer][semver] adherence isn't evenly dispersed in the Ruby community.
|
26
112
|
|
27
|
-
The
|
28
|
-
for [not following SemVer](https://github.com/rubocop/rubocop/issues/4243)
|
29
|
-
|
30
|
-
|
113
|
+
The RuboCop team [has reasons](https://github.com/semver/semver/issues/317)
|
114
|
+
for [not following SemVer](https://github.com/rubocop/rubocop/issues/4243).
|
115
|
+
|
116
|
+
NOTE: They think they are following SemVer,
|
117
|
+
but their interpretation differs from mine, and seems to differ from the
|
118
|
+
[intent of SemVer's creator][major-versions-not-sacred].
|
31
119
|
|
32
120
|
<p align="left">
|
33
121
|
<a href="https://metaredux.com/posts/2022/04/21/rubocop-turns-10.html" target="_blank" rel="noopener">
|
@@ -36,53 +124,94 @@ what brought you here.
|
|
36
124
|
</p>
|
37
125
|
|
38
126
|
The purpose of this gem is to constrain the `rubocop` dependency of a project in
|
39
|
-
a [SemVer compliant]
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
[
|
75
|
-
|
76
|
-
[
|
77
|
-
[
|
78
|
-
[
|
79
|
-
[
|
80
|
-
[
|
81
|
-
|
127
|
+
a [SemVer compliant][semver]
|
128
|
+
(Semantic Versioning, [Major Versions are Not Sacred][major-versions-not-sacred])
|
129
|
+
way that aligns with its desired minimum compatible/supported Ruby version.
|
130
|
+
Secondary purpose is to provide default configurations for a bevy of RuboCop-related plugins.
|
131
|
+
|
132
|
+
## 💎 Ruby Version Support
|
133
|
+
|
134
|
+
This gem facilitates equivalent of adding a `~> ` version constrained `rubocop`(-ish +more) dependency,
|
135
|
+
thus minimizing the risk of a rubocop minor / patch upgrade breaking the build.
|
136
|
+
|
137
|
+
### What's that you say?
|
138
|
+
|
139
|
+
This gem will install a suite of tools that will **analyze & lint code** intended to support any version of Ruby >= 2.0.
|
140
|
+
|
141
|
+
This gem helps insulate projects from RuboCop churn by enshrining many conventions
|
142
|
+
that have been shown over years to reduce problems.
|
143
|
+
|
144
|
+
#### Background
|
145
|
+
|
146
|
+
Each [spring `rubocop` drops][rubocop-support-matrix] the ability to **install** and **run** `rubocop` on an EOL'd Ruby.
|
147
|
+
Eventually `rubocop` will drop the ability to **analyze code** intended to support an EOL'd Ruby,
|
148
|
+
as they already have for Ruby 1.9. RuboCop has never run properly on Ruby 1.8.
|
149
|
+
This gem, via [standard (Standard Ruby)][standardrb], allows RuboCop to analyze Ruby 2.4 code,
|
150
|
+
by turning off certain rules that only apply to later Rubies.
|
151
|
+
|
152
|
+
When the `rubocop` team makes _any_ of these changes they
|
153
|
+
[only bump the minor version][rubocop-versioning] of RuboCop,
|
154
|
+
in violation of SemVer ([they disagree][rubocop-release-policy]).
|
155
|
+
|
156
|
+
In other words, RuboCop intentionally does not bump the major version when they drop
|
157
|
+
_analysis_, _runtime_, or _installation_ support for a given version of Ruby.
|
158
|
+
|
159
|
+
This is a primary _raison d’être_ for this project.
|
160
|
+
To get a better understanding of how SemVer is intended to work read this article from the creator of SemVer:
|
161
|
+
|
162
|
+
- ["Major Version Numbers are Not Sacred"][major-versions-not-sacred]!
|
163
|
+
|
164
|
+
[rubocop-support-matrix]: https://docs.rubocop.org/rubocop/compatibility.html#support-matrix
|
165
|
+
[rubocop-versioning]: https://docs.rubocop.org/rubocop/versioning.html
|
166
|
+
[rubocop-release-policy]: https://docs.rubocop.org/rubocop/versioning.html#release-policy
|
167
|
+
[major-versions-not-sacred]: https://tom.preston-werner.com/2022/05/23/major-version-numbers-are-not-sacred.html
|
168
|
+
[standardrb]: https://github.com/standardrb/standard
|
169
|
+
|
170
|
+
### 👪 A Gem Family
|
171
|
+
|
172
|
+
The `rubocop-lts` family of gems has a version supporting any version of Ruby you need.
|
173
|
+
They can be used as development dependencies for libraries or applications.
|
174
|
+
|
175
|
+
- [`rubocop-lts`][rlts]
|
176
|
+
- [`standard-rubocop-lts`][stdrlts]
|
177
|
+
- [`rubocop-ruby1_8`][rr18]
|
178
|
+
- [`rubocop-ruby1_9`][rr19]
|
179
|
+
- [`rubocop-ruby2_0`][rr20]
|
180
|
+
- [`rubocop-ruby2_1`][rr21]
|
181
|
+
- [`rubocop-ruby2_2`][rr22]
|
182
|
+
- [`rubocop-ruby2_3`][rr23]
|
183
|
+
- [`rubocop-ruby2_4`][rr24]
|
184
|
+
- [`rubocop-ruby2_5`][rr25]
|
185
|
+
- [`rubocop-ruby2_6`][rr26]
|
186
|
+
- [`rubocop-ruby2_7`][rr27]
|
187
|
+
- [`rubocop-ruby3_0`][rr30]
|
188
|
+
- [`rubocop-ruby3_1`][rr31]
|
189
|
+
- [`rubocop-ruby3_2`][rr32]
|
190
|
+
|
191
|
+
[rlts]: https://github.com/rubocop-lts/rubocop-lts#-how-to-untie-gorgons-knot
|
192
|
+
[stdrlts]: https://github.com/rubocop-lts/standard-rubocop-lts
|
193
|
+
[rr18]: https://gitlab.com/rubocop-lts/standard-rubocop-lts
|
194
|
+
[rr19]: https://gitlab.com/rubocop-lts/rubocop-ruby1_9
|
195
|
+
[rr20]: https://gitlab.com/rubocop-lts/rubocop-ruby2_0
|
196
|
+
[rr21]: https://gitlab.com/rubocop-lts/rubocop-ruby2_1
|
197
|
+
[rr22]: https://gitlab.com/rubocop-lts/rubocop-ruby2_2
|
198
|
+
[rr23]: https://gitlab.com/rubocop-lts/rubocop-ruby2_3
|
199
|
+
[rr24]: https://gitlab.com/rubocop-lts/rubocop-ruby2_4
|
200
|
+
[rr25]: https://gitlab.com/rubocop-lts/rubocop-ruby2_5
|
201
|
+
[rr26]: https://gitlab.com/rubocop-lts/rubocop-ruby2_6
|
202
|
+
[rr27]: https://gitlab.com/rubocop-lts/rubocop-ruby2_7
|
203
|
+
[rr30]: https://gitlab.com/rubocop-lts/rubocop-ruby3_0
|
204
|
+
[rr31]: https://gitlab.com/rubocop-lts/rubocop-ruby3_1
|
205
|
+
[rr32]: https://gitlab.com/rubocop-lts/rubocop-ruby3_2
|
82
206
|
|
83
207
|
## 🗿 Stable
|
84
208
|
|
85
|
-
All releases of this gem are stable releases.
|
209
|
+
All releases of this gem are stable releases.
|
210
|
+
We do not release new versions for every release of `rubocop`,
|
211
|
+
as this gem is tied to [standard (Standard Ruby)][standardrb].
|
212
|
+
A typical release cycle for a gem in the `rubocop-lts` family is roughly every six months,
|
213
|
+
though eventually analysis support for an old version of Ruby will be dropped.
|
214
|
+
When that happens releases of the `rubocop-lts` gem for that version of Ruby will (mostly) cease.
|
86
215
|
|
87
216
|
## ✨ Installation
|
88
217
|
|
@@ -94,43 +223,89 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
94
223
|
|
95
224
|
$ gem install rubocop-ruby2_4
|
96
225
|
|
97
|
-
## 🔧 Usage
|
98
|
-
|
99
|
-
The following is optional. We'll discuss why you might want to do this after you see what it does.
|
226
|
+
## 🔧 Basic Usage
|
100
227
|
|
101
|
-
|
228
|
+
If you are using Rails, building a Rubygem, or not using RSpec, see ["Advanced Usage"](#advanced-usage).
|
229
|
+
Otherwise, if you using this in plain Ruby _and_ RSpec, you can add to the top of your project's `.rubocop.yml` configuration file:
|
102
230
|
|
103
231
|
```yaml
|
104
232
|
inherit_gem:
|
105
233
|
rubocop-ruby2_4: rubocop.yml
|
106
234
|
```
|
107
235
|
|
108
|
-
|
236
|
+
Among _many_ other settings, this has the effect of declaring the following:
|
109
237
|
|
110
238
|
```yaml
|
111
239
|
AllCops:
|
112
|
-
# remove if already present in your `.rubocop.yml` to gain the full benefit of this gem!
|
113
|
-
TargetRubyVersion: 2.4
|
114
240
|
NewCops: enable
|
115
241
|
```
|
116
242
|
|
117
|
-
Let's talk about these settings.
|
243
|
+
Let's talk about these settings. (TODO: Document some of the other settings!)
|
244
|
+
|
245
|
+
### ⚙️ `NewCops: enable`
|
246
|
+
|
247
|
+
Upgrades to the latest RuboCop can include all kinds of changes, including removing support for the version of Ruby your project uses, or adding a cop that may not work with some of your syntax (e.g. [some use cases of 'module_function`](https://github.com/rubocop/rubocop/issues/5953#issuecomment-805921993)). Accepting new cops arriving in a new version of RuboCop can feel risky, especially when it doesn't follow SemVer.
|
248
|
+
|
249
|
+
But this gem shoehorns RuboCop into SemVer, under the watchful eye of [standard (Standard Ruby)][standardrb]... so `NewCops` is now safe(r)! If you use a dependency greening tool like GitHub's `dependabot`, or the excellent alternatives [depfu](https://depfu.com/), and [`renovate`](https://www.whitesourcesoftware.com/free-developer-tools/renovate/), then you can see the effect of a minor / major version bump in your CI Build!
|
250
|
+
|
251
|
+
## Advanced Usage
|
252
|
+
|
253
|
+
### Linting Ruby + RSpec
|
118
254
|
|
119
|
-
|
255
|
+
```yaml
|
256
|
+
inherit_gem:
|
257
|
+
rubocop-ruby2_4: rubocop-lts/ruby_rspec.yml
|
258
|
+
# Note: technically the above is the same as the "Basic Usage" below, so if specificity is not your jam:
|
259
|
+
# rubocop-ruby2_4: rubocop.yml
|
260
|
+
```
|
120
261
|
|
121
|
-
|
262
|
+
### Linting Ruby w/o RSpec
|
122
263
|
|
123
|
-
|
264
|
+
```yaml
|
265
|
+
inherit_gem:
|
266
|
+
rubocop-ruby2_4: rubocop-lts/ruby.yml
|
267
|
+
```
|
124
268
|
|
125
|
-
|
269
|
+
### Linting Rails + RSpec
|
126
270
|
|
127
|
-
|
271
|
+
```yaml
|
272
|
+
inherit_gem:
|
273
|
+
rubocop-ruby2_4: rubocop-lts/rails_rspec.yml
|
274
|
+
```
|
128
275
|
|
129
|
-
|
276
|
+
#### Linting Rails w/o RSpec
|
130
277
|
|
131
|
-
|
278
|
+
```yaml
|
279
|
+
inherit_gem:
|
280
|
+
rubocop-ruby2_4: rubocop-lts/rails.yml
|
281
|
+
```
|
132
282
|
|
133
|
-
|
283
|
+
#### Linting a RubyGem + RSpec
|
284
|
+
|
285
|
+
```yaml
|
286
|
+
inherit_gem:
|
287
|
+
rubocop-ruby2_4: rubocop-lts/rubygem_rspec.yml
|
288
|
+
```
|
289
|
+
|
290
|
+
#### Linting a RubyGem w/o RSpec
|
291
|
+
|
292
|
+
```yaml
|
293
|
+
inherit_gem:
|
294
|
+
rubocop-ruby2_4: rubocop-lts/rubygem.yml
|
295
|
+
```
|
296
|
+
|
297
|
+
## 💻 Development
|
298
|
+
|
299
|
+
After checking out the repo, run `bin/setup` to install dependencies.
|
300
|
+
Then, run `rake spec` to run the tests w/ coverage,
|
301
|
+
or `bin/rake` to run tests w/ coverage, and linting.
|
302
|
+
You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
303
|
+
|
304
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
305
|
+
|
306
|
+
### 🚀 Release Instructions
|
307
|
+
|
308
|
+
See [CONTRIBUTING.md][contributing].
|
134
309
|
|
135
310
|
## ⚡️ Contributing
|
136
311
|
|
@@ -145,8 +320,8 @@ Made with [contributors-img](https://contrib.rocks).
|
|
145
320
|
## 📄 License
|
146
321
|
|
147
322
|
The gem is available as open source under the terms of
|
148
|
-
the [MIT License][license] [![License: MIT]
|
149
|
-
See [LICENSE][license] for the official [Copyright Notice][copyright-notice-explainer].
|
323
|
+
the [MIT License][license] [![License: MIT][license-img]][license-ref].
|
324
|
+
See [LICENSE.txt][license] for the official [Copyright Notice][copyright-notice-explainer].
|
150
325
|
|
151
326
|
<details>
|
152
327
|
<summary>Project Logos (rubocop-ruby2_4)</summary>
|
@@ -155,7 +330,7 @@ See [docs/images/logo/README.txt][project-logos]
|
|
155
330
|
</details>
|
156
331
|
|
157
332
|
<details>
|
158
|
-
<summary>Organization Logo (rubocop-
|
333
|
+
<summary>Organization Logo (rubocop-lts)</summary>
|
159
334
|
|
160
335
|
Author: [Yusuf Evli][org-logo-author]
|
161
336
|
Source: [Unsplash][org-logo-source]
|
@@ -169,13 +344,13 @@ License: [Unsplash License][org-logo-license]
|
|
169
344
|
|
170
345
|
### © Copyright
|
171
346
|
|
172
|
-
* Copyright (c) 2022 [Peter H. Boling][peterboling] of [Rails Bling][railsbling]
|
173
|
-
|
174
|
-
[copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
|
347
|
+
* Copyright (c) 2022 - 2023 [Peter H. Boling][peterboling] of [Rails Bling][railsbling]
|
175
348
|
|
176
349
|
## 🤝 Code of Conduct
|
177
350
|
|
178
|
-
Everyone interacting in
|
351
|
+
Everyone interacting in this project's codebases, issue trackers, [chat rooms][🏘chat] and mailing lists is expected to follow the [code of conduct][🤝conduct].
|
352
|
+
|
353
|
+
[🤝conduct]: https://gitlab.com/rubocop-lts/rubocop-ruby2_4/-/blob/main/CODE_OF_CONDUCT.md
|
179
354
|
|
180
355
|
## 📌 Versioning
|
181
356
|
|
@@ -190,67 +365,36 @@ the [Pessimistic Version Constraint][pvc] with two digits of precision.
|
|
190
365
|
For example:
|
191
366
|
|
192
367
|
```ruby
|
193
|
-
spec.add_dependency "rubocop-ruby2_4", "~>
|
368
|
+
spec.add_dependency "rubocop-ruby2_4", "~> 2.0"
|
194
369
|
```
|
195
370
|
|
371
|
+
[aboutme]: https://about.me/peter.boling
|
372
|
+
[actions]: https://github.com/rubocop-lts/rubocop-ruby2_4/actions
|
373
|
+
[angelme]: https://angel.co/peter-boling
|
374
|
+
[blogpage]: http://www.railsbling.com/tags/rubocop-ruby2_4/
|
375
|
+
[codecov_coverage]: https://codecov.io/gh/rubocop-lts/rubocop-ruby2_4
|
376
|
+
[code_triage]: https://www.codetriage.com/rubocop-lts/rubocop-ruby2_4
|
377
|
+
[🏘chat]: https://gitter.im/rubocop-lts/community
|
378
|
+
[climate_coverage]: https://codeclimate.com/github/rubocop-lts/rubocop-ruby2_4/test_coverage
|
379
|
+
[climate_maintainability]: https://codeclimate.com/github/rubocop-lts/rubocop-ruby2_4/maintainability
|
196
380
|
[copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
|
197
|
-
|
198
|
-
[gh_discussions]: https://github.com/rubocop-lts/rubocop-ruby2_4/discussions
|
199
|
-
|
200
381
|
[conduct]: https://github.com/rubocop-lts/rubocop-ruby2_4/blob/main/CODE_OF_CONDUCT.md
|
201
|
-
|
202
382
|
[contributing]: https://github.com/rubocop-lts/rubocop-ruby2_4/blob/main/CONTRIBUTING.md
|
203
|
-
|
204
|
-
[
|
205
|
-
|
206
|
-
[
|
207
|
-
|
383
|
+
[devto]: https://dev.to/galtzo
|
384
|
+
[documentation]: https://rubydoc.info/github/rubocop-lts/rubocop-ruby2_4/main
|
385
|
+
[followme]: https://img.shields.io/twitter/follow/galtzo.svg?style=social&label=Follow
|
386
|
+
[gh_discussions]: https://github.com/rubocop-lts/rubocop-ruby2_4/discussions
|
387
|
+
[gh_sponsors]: https://github.com/sponsors/pboling
|
388
|
+
[issues]: https://github.com/rubocop-lts/rubocop-ruby2_4/issues
|
389
|
+
[liberapay_donate]: https://liberapay.com/pboling/donate
|
390
|
+
[license]: LICENSE.txt
|
208
391
|
[license-ref]: https://opensource.org/licenses/MIT
|
209
|
-
|
210
|
-
[
|
211
|
-
|
392
|
+
[license-img]: https://img.shields.io/badge/License-MIT-green.svg
|
393
|
+
[peterboling]: http://www.peterboling.com
|
212
394
|
[pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
|
213
|
-
|
214
395
|
[railsbling]: http://www.railsbling.com
|
215
|
-
|
216
|
-
[peterboling]: http://www.peterboling.com
|
217
|
-
|
218
|
-
[aboutme]: https://about.me/peter.boling
|
219
|
-
|
220
|
-
[angelme]: https://angel.co/peter-boling
|
221
|
-
|
222
|
-
[coderme]:http://coderwall.com/pboling
|
223
|
-
|
224
|
-
[followme-img]: https://img.shields.io/twitter/follow/galtzo.svg?style=social&label=Follow
|
225
|
-
|
226
|
-
[tweetme]: http://twitter.com/galtzo
|
227
|
-
|
228
|
-
[politicme]: https://nationalprogressiveparty.org
|
229
|
-
|
230
|
-
[documentation]: https://rubydoc.info/github/rubocop-lts/rubocop-ruby2_4/main
|
231
|
-
|
232
|
-
[source]: https://github.com/rubocop-lts/rubocop-ruby2_4/
|
233
|
-
|
234
|
-
[actions]: https://github.com/rubocop-lts/rubocop-ruby2_4/actions
|
235
|
-
|
236
|
-
[issues]: https://github.com/rubocop-lts/rubocop-ruby2_4/issues
|
237
|
-
|
238
|
-
[climate_maintainability]: https://codeclimate.com/github/rubocop-lts/rubocop-ruby2_4/maintainability
|
239
|
-
|
240
|
-
[climate_coverage]: https://codeclimate.com/github/rubocop-lts/rubocop-ruby2_4/test_coverage
|
241
|
-
|
242
|
-
[codecov_coverage]: https://codecov.io/gh/rubocop-lts/rubocop-ruby2_4
|
243
|
-
|
244
|
-
[code_triage]: https://www.codetriage.com/rubocop-lts/rubocop-ruby2_4
|
245
|
-
|
246
|
-
[blogpage]: http://www.railsbling.com/tags/rubocop-ruby2_4/
|
247
|
-
|
248
396
|
[rubygems]: https://rubygems.org/gems/rubocop-ruby2_4
|
249
|
-
|
250
|
-
[
|
251
|
-
|
252
|
-
[
|
253
|
-
|
254
|
-
[liberapay_donate]: https://liberapay.com/pboling/donate
|
255
|
-
|
256
|
-
[gh_sponsors]: https://github.com/sponsors/pboling
|
397
|
+
[security]: https://github.com/rubocop-lts/rubocop-ruby2_4/blob/main/SECURITY.md
|
398
|
+
[semver]: http://semver.org/
|
399
|
+
[source]: https://github.com/rubocop-lts/rubocop-ruby2_4/
|
400
|
+
[tweetme]: http://twitter.com/galtzo
|