rubocop-ruby1_9 1.0.5 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -16,18 +16,106 @@
16
16
  </a>
17
17
  </p>
18
18
 
19
- # Rubocop::Ruby19
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-ruby1_9`][⛳️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-ruby1_9.svg
62
+ [🖇️ini-dti]: https://img.shields.io/gem/dt/rubocop-ruby1_9.svg
63
+ [🏘️ini-rti]: https://img.shields.io/gem/rt/rubocop-ruby1_9.svg
64
+ [🚎ini-cwf]: https://github.com/rubocop-lts/rubocop-ruby1_9/actions/workflows/current.yml
65
+ [🚎ini-cwfi]: https://github.com/rubocop-lts/rubocop-ruby1_9/actions/workflows/current.yml/badge.svg
66
+ [🖐ini-hwf]: https://github.com/rubocop-lts/rubocop-ruby1_9/actions/workflows/heads.yml
67
+ [🖐ini-hwfi]: https://github.com/rubocop-lts/rubocop-ruby1_9/actions/workflows/heads.yml/badge.svg
68
+ [🧮ini-lwf]: https://github.com/rubocop-lts/rubocop-ruby1_9/actions/workflows/legacy.yml
69
+ [🧮ini-lwfi]: https://github.com/rubocop-lts/rubocop-ruby1_9/actions/workflows/legacy.yml/badge.svg
70
+ [📗ini-io]: https://github.com/rubocop-lts/rubocop-ruby1_9/issues
71
+ [📗ini-ioi]: https://img.shields.io/github/issues-raw/rubocop-lts/rubocop-ruby1_9
72
+ [🚀ini-ic]: https://github.com/rubocop-lts/rubocop-ruby1_9/issues?q=is%3Aissue+is%3Aclosed
73
+ [🚀ini-ici]: https://img.shields.io/github/issues-closed-raw/rubocop-lts/rubocop-ruby1_9
74
+ [💄ini-po]: https://github.com/rubocop-lts/rubocop-ruby1_9/pulls
75
+ [💄ini-poi]: https://img.shields.io/github/issues-pr/rubocop-lts/rubocop-ruby1_9
76
+ [👽ini-pc]: https://github.com/rubocop-lts/rubocop-ruby1_9/pulls?q=is%3Apr+is%3Aclosed
77
+ [👽ini-pci]: https://img.shields.io/github/issues-pr-closed/rubocop-lts/rubocop-ruby1_9
78
+ [⛳️ini-g]: https://rubygems.org/gems/rubocop-ruby1_9
79
+ [⛳️ini-gh]: https://github.com/rubocop-lts/rubocop-ruby1_9
80
+
81
+ # 🦾 Rubocop::Ruby19
20
82
 
21
83
  See the intro [blog post](https://dev.to/pboling/rubocop-ruby-matrix-gems-nj)!
22
84
 
23
- This gem requires no other gems. It depends on `rubocop`, but does not `require 'rubocop'`.
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 Rubocop team [has real reasons](https://github.com/semver/semver/issues/317)
28
- for [not following SemVer](https://github.com/rubocop/rubocop/issues/4243), but if you've
29
- found this project their reasons likely weigh less, in your context (e.g. running `rubocop` from command line), than
30
- what brought you here.
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,181 +124,188 @@ 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](https://semver.org/) (Semantic Versioning) way that aligns with the the desired minimum
40
- compatible/supported Ruby version.
41
-
42
- ## Ruby Version Support Matrix
43
-
44
- Adding this gem will facilitate the best practice of adding a `~> ` version constrained `rubocop` dependency, while
45
- minimizing the risk of a rubocop minor / patch upgrade breaking the build. See the
46
- official [compatibility matrix][rubocop-matrix] for `rubocop`.
47
-
48
- `rubocop-ruby1_9` (this gem) will install on any version of Ruby >= 1.9, can be used to analyze Ruby >= 1.8.7 code, but will not execute on Ruby 3.1.
49
-
50
- * 🧊 - Install on Ruby `<version>`
51
- * 🏃‍ - Will Execute on Ruby `<version>`
52
- * 🪷 - Will not execute correctly on Ruby `<version>`
53
- * 🛠 - Lint code with Ruby `<version>` syntax as the target
54
-
55
- | gem | 1.8.7 | 1.9.3 | 2.0 | 2.1 | 2.2 | 2.3 | 2.4 | 2.5 | 2.6 | 2.7 | 3.0 | 3.1 | ruby-head | jruby-head |
56
- |-------------------------|---------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|
57
- | [rubocop-ruby1_9][rr19] | [🛠][what1_8] | 🧊 🏃‍ 🛠 | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🪷 | 🧊 🪷 | 🧊 🪷 |
58
- | [rubocop-ruby2_0][rr20] | | | 🧊 🏃‍ 🛠 | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🪷 | 🧊 🪷 | 🧊 🪷 |
59
- | [rubocop-ruby2_1][rr21] | | | | 🧊 🏃‍ 🛠 | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🪷 | 🧊 🪷 | 🧊 🪷 |
60
- | [rubocop-ruby2_2][rr22] | | | | | 🧊 🏃‍ 🛠 | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊‍ 🪷 | 🧊 🪷 | 🧊 🪷 | 🧊 🪷 |
61
- | [rubocop-ruby2_3][rr23] | | | | | | 🧊 🏃‍ 🛠 | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🪷 | 🧊 🪷 | 🧊 🪷 |
62
- | [rubocop-ruby2_4][rr24] | | | | | | | 🧊 🏃‍ 🛠 | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🪷 | 🧊 🪷 | 🧊 🪷 |
63
- | [rubocop-ruby2_5][rr25] | | | | | | | | 🧊 🏃‍ 🛠 | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🪷 |
64
- | [rubocop-ruby2_6][rr26] | | | | | | | | 🛠 | 🧊 🏃‍ 🛠 | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🪷 |
65
- | [rubocop-ruby2_7][rr27] | | | | | | | | 🛠 | 🛠 | 🧊 🏃‍ 🛠 | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ |
66
- | [rubocop-ruby3_0][rr30] | | | | | | | | 🛠 | 🛠 | 🛠 | 🧊 🏃‍ 🛠 | 🧊 🏃‍ | 🧊 🏃‍ | 🧊 🏃‍ |
67
- | [rubocop-ruby3_1][rr31] | | | | | | | | 🛠 | 🛠 | 🛠 | 🛠 | 🧊 🏃‍ 🛠 | 🧊 🏃‍ | 🧊 🏃‍ |
68
-
69
- [rr19]: https://github.com/rubocop-lts/rubocop-ruby1_9
70
- [rr20]: https://github.com/rubocop-lts/rubocop-ruby2_0
71
- [rr21]: https://github.com/rubocop-lts/rubocop-ruby2_1
72
- [rr22]: https://github.com/rubocop-lts/rubocop-ruby2_2
73
- [rr23]: https://github.com/rubocop-lts/rubocop-ruby2_3
74
- [rr24]: https://github.com/rubocop-lts/rubocop-ruby2_4
75
- [rr25]: https://github.com/rubocop-lts/rubocop-ruby2_5
76
- [rr26]: https://github.com/rubocop-lts/rubocop-ruby2_6
77
- [rr27]: https://github.com/rubocop-lts/rubocop-ruby2_7
78
- [rr30]: https://github.com/rubocop-lts/rubocop-ruby3_0
79
- [rr31]: https://github.com/rubocop-lts/rubocop-ruby3_1
80
- [what1_8]: https://github.com/rubocop-lts/rubocop-ruby1_9#what-about-ruby-18
81
- [rubocop-matrix]: https://github.com/rubocop/rubocop/blob/master/docs/modules/ROOT/pages/compatibility.adoc#support-matrix
82
-
83
- ## 📼 Supporting Ruby v1... in 2022?
84
-
85
- Many gems, and many of those among the most popular gems in all of Ruby-land (e.g. [rspec](https://rubygems.org/gems/rspec/versions/3.11.0), [os](https://rubygems.org/gems/os)) still do not specify a `required_ruby_version`, or they list it as `>= 0`.
86
-
87
- If those gems want to:
88
- * follow semver, and
89
- * deprecate old rubies, then
90
- * they need to first figure out what version of Ruby is currently supported, and
91
- * once having determined the oldest supported version, they may want to enforce that support via linting, hence this family of gems.
92
-
93
- NOTE: Some gems, e.g. rspec, are intentionally supporting Ruby 1.8.7 in 2022!
94
-
95
- If you think about the use case of RSpec a bit this makes sense, as it would be ideal for the community for RSpec to be the last gem to drop support for Ruby 1.8.7. I wrote a [suite](https://railsbling.com/tags/rspec/) of RSpec extension gems, and I try to support the same versions of Ruby as RSpec does with my extensions.
96
-
97
- This gem targets, and will run, on Ruby 1.9. RuboCop used to be able to analyze Ruby 1.8, and this gem makes use of that. If you are still supporting Ruby 1.8, see [What about Ruby 1.8?][what1_8] further down the page, because we can help!
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 >= 1.9.
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 1.9 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
98
206
 
99
207
  ## 🗿 Stable
100
208
 
101
- All releases of this gem are stable releases. The first version is `1.0.0`.
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.
102
215
 
103
216
  ## ✨ Installation
104
217
 
105
- Without bundler execute:
106
-
107
- $ gem install
108
-
109
- Add this line to your application's Gemfile:
110
-
111
- ```ruby
112
- gem 'rubocop-ruby1_9', '~> 1.0', require: false
113
- ```
114
-
115
- And then execute:
218
+ Install the gem and add to the application's Gemfile by executing:
116
219
 
117
- $ bundle
220
+ $ bundle add rubocop-ruby1_9 -r false
118
221
 
119
- Or install it yourself as:
222
+ If bundler is not being used to manage dependencies, install the gem by executing:
120
223
 
121
224
  $ gem install rubocop-ruby1_9
122
225
 
123
- ## 🔧 Usage
124
-
125
- The following is optional. We'll discuss why you might want to do this after you see what it does.
226
+ ## 🔧 Basic Usage
126
227
 
127
- Add to the top of your project's `.rubocop.yml` configuration file:
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:
128
230
 
129
231
  ```yaml
130
232
  inherit_gem:
131
233
  rubocop-ruby1_9: rubocop.yml
132
234
  ```
133
235
 
134
- This has the same effect as you declaring the following in your `.rubocop.yml`:
236
+ Among _many_ other settings, this has the effect of declaring the following:
135
237
 
136
238
  ```yaml
137
- # AllCops:
138
- # The sibling gems for newer versions of Ruby support the TargetRubyVersion directive as soon as RuboCop adds it.
139
- # TargetRubyVersion: 1.9
140
- # The sibling gems for newer versions of Ruby support the NewCops directive as soon as RuboCop adds it.
141
- # NewCops: enable
142
-
143
- Style/BracesAroundHashParameters:
144
- Enabled: true
145
- EnforcedStyle: context_dependent
146
-
147
- Style/Encoding:
148
- Enabled: true
149
- EnforcedStyle: always
150
-
151
- Style/ExpandPathArguments:
152
- Enabled: false
239
+ AllCops:
240
+ NewCops: enable
153
241
  ```
154
242
 
155
- Let's talk about these settings.
156
-
157
- ## TargetRubyVersion
158
-
159
- Commented out! Setting does not exist in the very old version of rubocop that works with Ruby 1.9.
160
-
161
- If you want to use this you'll have to upgrade to Ruby >= 2.0 and use the appropriate sibling gem, e.g. [`rubocop-ruby2_0`][2-0].
243
+ Let's talk about these settings. (TODO: Document some of the other settings!)
162
244
 
163
- [2-0]: https://github.com/rubocop-lts/rubocop-ruby2_0
245
+ ### ⚙️ `NewCops: enable`
164
246
 
165
- ## NewCops: enable
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.
166
248
 
167
- Commented out! Setting does not exist in very old versions of rubocop that work with Ruby < 2.4.
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!
168
250
 
169
- If you want to use this you'll have to upgrade to Ruby >= 2.4 and use the appropriate sibling gem, e.g. [`rubocop-ruby2_4`][2-4].
251
+ ## Advanced Usage
170
252
 
171
- [2-4]: https://github.com/rubocop-lts/rubocop-ruby2_4
253
+ ### Linting Ruby + RSpec
172
254
 
173
- ## Style/BracesAroundHashParameters
255
+ ```yaml
256
+ inherit_gem:
257
+ rubocop-ruby1_9: 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-ruby1_9: rubocop.yml
260
+ ```
174
261
 
175
- In an effort to help users of this gem prepare their code for more modern Rubies it has been enabled and configured with `coontext_dependent` as the closest parallel to what will work with Ruby 2.7+, and also retain compatibility with old Ruby.
262
+ ### Linting Ruby w/o RSpec
176
263
 
177
- See:
178
- * https://github.com/rubocop/rubocop/issues/7641
179
- * https://github.com/rubocop/rubocop/pull/7643
264
+ ```yaml
265
+ inherit_gem:
266
+ rubocop-ruby1_9: rubocop-lts/ruby.yml
267
+ ```
180
268
 
181
- NOTE: This cop was removed from RuboCop as of 0.80.0, so if you are on modern RuboCop and reading this for some reason, you can't use it.
269
+ ### Linting Rails + RSpec
182
270
 
183
- ## Style/Encoding
271
+ ```yaml
272
+ inherit_gem:
273
+ rubocop-ruby1_9: rubocop-lts/rails_rspec.yml
274
+ ```
184
275
 
185
- The encoding comments can be removed once your project drops Ruby 1.9 support (and this gem!).
186
- Whole file UTF-8 Encoding is default in Ruby 2+, so the Encoding comment is usually not needed there.
187
- See:
188
- * https://www.rubydoc.info/gems/rubocop/0.49.0/RuboCop/Cop/Style/Encoding
276
+ #### Linting Rails w/o RSpec
189
277
 
190
- ## What about Ruby 1.8!
278
+ ```yaml
279
+ inherit_gem:
280
+ rubocop-ruby1_9: rubocop-lts/rails.yml
281
+ ```
191
282
 
192
- RuboCop has _never_ supported running on Ruby 1.8.7, but it did [used to support](https://github.com/rubocop/rubocop/issues/2640#issuecomment-378024741) analyzing it. To that end, there is a set of RuboCop rules you can use if your project still supports Ruby 1.8.
283
+ #### Linting a RubyGem + RSpec
193
284
 
194
285
  ```yaml
195
286
  inherit_gem:
196
- rubocop-ruby1_9: rubocop-ruby1_8.yml
287
+ rubocop-ruby1_9: rubocop-lts/rubygem_rspec.yml
197
288
  ```
198
289
 
199
- I won't copy the set of rules here, but you can peruse them [here](https://github.com/rubocop-lts/rubocop-ruby1_9/blob/main/rubocop-ruby1_8.yml). If the rules don't fit exactly your needs, you can just copy them out to your own `.rubocop.yml` config and modify!
290
+ #### Linting a RubyGem w/o RSpec
200
291
 
201
- Three different projects informed these Rubocop rules for 1.8.7.
292
+ ```yaml
293
+ inherit_gem:
294
+ rubocop-ruby1_9: rubocop-lts/rubygem.yml
295
+ ```
202
296
 
203
- * [rubocop_187's .rubocop-yml](https://github.com/teoucsb82/rubocop_187/blob/master/.rubocop.yml) - because `rubocop_187` is a Rails app built to Ruby-1.8.7-ify code added to it.
204
- * [rspec's .rubocop-yml](https://github.com/rspec/rspec-core/blob/main/.rubocop.yml) - because `rspec` still supports Ruby 1.8.7
205
- * [rspec-pending_for's .rubocop.yml](https://github.com/pboling/rspec-pending_for/blob/master/.rubocop.yml) - because `rspec-pending_for` still supports Ruby 1.8.7
297
+ ## 💻 Development
206
298
 
207
- If you have suggestions for a rule that improves compatibility with Ruby forward from 1.9 or 1.8, please let us know!
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.
208
303
 
209
- ## Development
304
+ To install this gem onto your local machine, run `bundle exec rake install`.
210
305
 
211
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
306
+ ### 🚀 Release Instructions
212
307
 
213
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
308
+ See [CONTRIBUTING.md][contributing].
214
309
 
215
310
  ## ⚡️ Contributing
216
311
 
@@ -225,37 +320,37 @@ Made with [contributors-img](https://contrib.rocks).
225
320
  ## 📄 License
226
321
 
227
322
  The gem is available as open source under the terms of
228
- the [MIT License][license] [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)][license-ref].
229
- 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].
230
325
 
231
326
  <details>
232
- <summary>Project Logos (rubocop-ruby3_1)</summary>
327
+ <summary>Project Logos (rubocop-ruby1_9)</summary>
233
328
 
234
329
  See [docs/images/logo/README.txt][project-logos]
235
330
  </details>
236
331
 
237
332
  <details>
238
- <summary>Organization Logo (rubocop-semver)</summary>
333
+ <summary>Organization Logo (rubocop-lts)</summary>
239
334
 
240
335
  Author: [Yusuf Evli][org-logo-author]
241
336
  Source: [Unsplash][org-logo-source]
242
337
  License: [Unsplash License][org-logo-license]
243
338
  </details>
244
339
 
245
- [project-logos]: https://github.com/rubocop-lts/rubocop-ruby3_1/blob/main/docs/images/logo/README.txt
340
+ [project-logos]: https://github.com/rubocop-lts/rubocop-ruby1_9/blob/main/docs/images/logo/README.txt
246
341
  [org-logo-author]: https://unsplash.com/@yusufevli
247
342
  [org-logo-source]: https://unsplash.com/photos/yaSLNLtKRIU
248
343
  [org-logo-license]: https://unsplash.com/license
249
344
 
250
345
  ### © Copyright
251
346
 
252
- * Copyright (c) 2022 [Peter H. Boling][peterboling] of [Rails Bling][railsbling]
253
-
254
- [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]
255
348
 
256
349
  ## 🤝 Code of Conduct
257
350
 
258
- Everyone interacting in the Rubocop::Ruby19 project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/rubocop-lts/rubocop-ruby1_9/blob/main/CODE_OF_CONDUCT.md).
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-ruby1_9/-/blob/main/CODE_OF_CONDUCT.md
259
354
 
260
355
  ## 📌 Versioning
261
356
 
@@ -270,63 +365,36 @@ the [Pessimistic Version Constraint][pvc] with two digits of precision.
270
365
  For example:
271
366
 
272
367
  ```ruby
273
- spec.add_dependency "rubocop-ruby1_9", "~> 1.0"
368
+ spec.add_dependency "rubocop-ruby1_9", "~> 2.0"
274
369
  ```
275
370
 
371
+ [aboutme]: https://about.me/peter.boling
372
+ [actions]: https://github.com/rubocop-lts/rubocop-ruby1_9/actions
373
+ [angelme]: https://angel.co/peter-boling
374
+ [blogpage]: http://www.railsbling.com/tags/rubocop-ruby1_9/
375
+ [codecov_coverage]: https://codecov.io/gh/rubocop-lts/rubocop-ruby1_9
376
+ [code_triage]: https://www.codetriage.com/rubocop-lts/rubocop-ruby1_9
377
+ [🏘chat]: https://gitter.im/rubocop-lts/community
378
+ [climate_coverage]: https://codeclimate.com/github/rubocop-lts/rubocop-ruby1_9/test_coverage
379
+ [climate_maintainability]: https://codeclimate.com/github/rubocop-lts/rubocop-ruby1_9/maintainability
276
380
  [copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
277
-
278
- [gh_discussions]: https://github.com/rubocop-lts/rubocop-ruby1_9/discussions
279
-
280
381
  [conduct]: https://github.com/rubocop-lts/rubocop-ruby1_9/blob/main/CODE_OF_CONDUCT.md
281
-
282
382
  [contributing]: https://github.com/rubocop-lts/rubocop-ruby1_9/blob/main/CONTRIBUTING.md
283
-
284
- [security]: https://github.com/rubocop-lts/rubocop-ruby1_9/blob/main/SECURITY.md
285
-
286
- [license]: https://github.com/rubocop-lts/rubocop-ruby1_9/blob/main/LICENSE.txt
287
-
383
+ [devto]: https://dev.to/galtzo
384
+ [documentation]: https://rubydoc.info/github/rubocop-lts/rubocop-ruby1_9/main
385
+ [followme]: https://img.shields.io/twitter/follow/galtzo.svg?style=social&label=Follow
386
+ [gh_discussions]: https://github.com/rubocop-lts/rubocop-ruby1_9/discussions
387
+ [gh_sponsors]: https://github.com/sponsors/pboling
388
+ [issues]: https://github.com/rubocop-lts/rubocop-ruby1_9/issues
389
+ [liberapay_donate]: https://liberapay.com/pboling/donate
390
+ [license]: LICENSE.txt
288
391
  [license-ref]: https://opensource.org/licenses/MIT
289
-
290
- [semver]: http://semver.org/
291
-
392
+ [license-img]: https://img.shields.io/badge/License-MIT-green.svg
393
+ [peterboling]: http://www.peterboling.com
292
394
  [pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
293
-
294
395
  [railsbling]: http://www.railsbling.com
295
-
296
- [peterboling]: http://www.peterboling.com
297
-
298
- [aboutme]: https://about.me/peter.boling
299
-
300
- [angelme]: https://angel.co/peter-boling
301
-
302
- [coderme]:http://coderwall.com/pboling
303
-
304
- [followme-img]: https://img.shields.io/twitter/follow/galtzo.svg?style=social&label=Follow
305
-
306
- [tweetme]: http://twitter.com/galtzo
307
-
308
- [politicme]: https://nationalprogressiveparty.org
309
-
310
- [documentation]: https://rubydoc.info/github/rubocop-lts/rubocop-ruby1_9/main
311
-
312
- [source]: https://github.com/rubocop-lts/rubocop-ruby1_9/
313
-
314
- [actions]: https://github.com/rubocop-lts/rubocop-ruby1_9/actions
315
-
316
- [issues]: https://github.com/rubocop-lts/rubocop-ruby1_9/issues
317
-
318
- [climate_maintainability]: https://codeclimate.com/github/rubocop-lts/rubocop-ruby1_9/maintainability
319
-
320
- [code_triage]: https://www.codetriage.com/rubocop-lts/rubocop-ruby1_9
321
-
322
- [blogpage]: http://www.railsbling.com/tags/rubocop-ruby1_9/
323
-
324
396
  [rubygems]: https://rubygems.org/gems/rubocop-ruby1_9
325
-
326
- [chat]: https://gitter.im/rubocop-lts/rubocop-ruby1_9?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
327
-
328
- [maintenancee_policy]: https://guides.rubyonrails.org/maintenance_policy.html#security-issues
329
-
330
- [liberapay_donate]: https://liberapay.com/pboling/donate
331
-
332
- [gh_sponsors]: https://github.com/sponsors/pboling
397
+ [security]: https://github.com/rubocop-lts/rubocop-ruby1_9/blob/main/SECURITY.md
398
+ [semver]: http://semver.org/
399
+ [source]: https://github.com/rubocop-lts/rubocop-ruby1_9/
400
+ [tweetme]: http://twitter.com/galtzo
data/SECURITY.md CHANGED
@@ -2,12 +2,13 @@
2
2
 
3
3
  ## Supported Versions
4
4
 
5
- | Version | Supported |
6
- | ------- | ------------------ |
7
- | 0.x | :white_check_mark: |
5
+ | Version | Supported |
6
+ |---------|-----------|
7
+ | 2.x | |
8
+ | 1.x | ❌ |
8
9
 
9
10
  ## Reporting a Vulnerability
10
11
 
11
12
  Peter Boling is the primary maintainer of this gem. Please find a way
12
13
  to [contact him directly](https://railsbling.com/contact) to report the issue. Include as much relevant information as
13
- possible.
14
+ possible.
@@ -0,0 +1,14 @@
1
+ module Rubocop
2
+ module Ruby19
3
+ class Railtie < Rails::Railtie
4
+ railtie_name :rubocop_ruby1_9
5
+
6
+ if Rails.env.test? || Rails.env.development?
7
+ rake_tasks do
8
+ path = File.expand_path(__dir__)
9
+ Dir.glob("#{path}/rakelib/**/*.rake").each { |f| load f }
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,11 @@
1
+ begin
2
+ require "rubocop/gradual/rake_task"
3
+
4
+ RuboCop::Gradual::RakeTask.new(:rubocop_gradual)
5
+ desc "alias rubocop task to rubocop_gradual"
6
+ task rubocop: :rubocop_gradual
7
+ rescue LoadError
8
+ task :rubocop_gradual do
9
+ warn "NOTE: rubocop-gradual isn't installed, or is disabled for #{RUBY_VERSION} in the current environment"
10
+ end
11
+ end
@@ -0,0 +1,4 @@
1
+ # Load from a "rakelib" directory is automatic!
2
+ # Adding our custom directory of tasks as a rakelib directory makes them available.
3
+ rakelib = "lib/rubocop/ruby1_9/rakelib"
4
+ Rake.add_rakelib(rakelib)
@@ -1,8 +1,9 @@
1
- # encoding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  module Rubocop
5
4
  module Ruby19
6
- VERSION = "1.0.5".freeze
5
+ module Version
6
+ VERSION = "2.0.3"
7
+ end
7
8
  end
8
9
  end