NOTE: You might be interested in rubocop-lts
which sits as a higher level than, and depends on, this gem.
It will enable your Ruby style rules to keep pace with whatever version of Ruby your project happens to be on!
Gem Name | Version | Downloads | CI | Activity |
---|---|---|---|---|
rubocop-lts |
||||
standard-rubocop-lts |
🦾 Standard::Rubocop::Lts
Extended standard (Standard Ruby) config shims for all your finely-aged rubies,
back to Ruby version 1.8. Compatible with the rubocop-lts
gem family.
Use the rules standard gives you, and then add more, to increase your code's compatibility across multiple versions of Ruby.
Only reach as far back as you need to go!
👪 A Gem Family
The rubocop-lts
family of gems has a version supporting any version of Ruby you need.
They can be used as development dependencies for libraries or applications.
rubocop-lts
standard-rubocop-lts
rubocop-ruby1_8
rubocop-ruby1_9
rubocop-ruby2_0
rubocop-ruby2_1
rubocop-ruby2_2
rubocop-ruby2_3
rubocop-ruby2_4
rubocop-ruby2_5
rubocop-ruby2_6
rubocop-ruby2_7
rubocop-ruby3_0
rubocop-ruby3_1
rubocop-ruby3_2
🗿 Stable
All releases of this gem are stable releases.
We do not release new versions for every release of rubocop
,
as this gem is tied to standard (Standard Ruby).
A typical release cycle for a gem in the rubocop-lts
family is roughly every six months,
though eventually analysis support for an old version of Ruby will be dropped.
When that happens releases of the rubocop-lts
gem for that version of Ruby will (mostly) cease.
✨ Installation
Install the gem and add to the application's Gemfile by executing:
$ bundle add standard-rubocop-lts
If bundler is not being used to manage dependencies, install the gem by executing:
$ gem install standard-rubocop-lts
🔧 Basic Usage
Add to the top of your project's .rubocop.yml
configuration file:
inherit_gem:
# Replace {RUBY_MAJOR_VERSION} with the minimum major version of ruby you want to target.
# Replace {RUBY_MINOR_VERSION} with the minimum minor version of ruby you want to target.
standard-rubocop-lts: config/ruby-{RUBY_MAJOR_VERSION}-{RUBY_MINOR_VERSION}.yml
What will this do for me?
Among other settings specific to your chosen minimum version of ruby, the above _effectively_ results in the following config (& more): ```yaml # We want Exclude and Include directives from different # config files to get merged, not overwritten inherit_mode: merge: - Exclude - Include require: - standard - standard-performance - standard-custom - rubocop-performance # Load basic rules for this version of Ruby from standard. # Rules are overridden in a LIFO stack. # If rubocop-performance is loaded first, and standard-performance after it, # then rubocop-performance's rules will take precedence. # This is the opposite of what you might expect. # Below: standard's rules override rubocop-performance's (mostly disabling rules) inherit_gem: standard: config/ruby-1.8.yml standard-performance: config/ruby-1.8.yml standard-custom: config/base.yml rubocop-performance: config/default.yml AllCops: NewCops: enable # See: # https://github.com/rubocop/rubocop-performance/issues/240 # https://github.com/rubocop/rubocop-performance/pull/241 Performance/Casecmp: Enabled: false # See: https://github.com/rubocop/rubocop-performance/issues/329#issuecomment-1375527811 Performance/BlockGivenWithExplicitBlock: Enabled: false # See: https://github.com/rubocop/rubocop-performance/issues/329#issuecomment-1451511402 Performance/ArraySemiInfiniteRangeSlice: Enabled: false # See: https://github.com/rubocop/rubocop-performance/issues/329#issuecomment-1451511402 Performance/BigDecimalWithNumericArgument: Enabled: false # See: https://github.com/rubocop/rubocop-performance/issues/329#issuecomment-1451511402 Performance/IoReadlines: Enabled: false # Plus: Ruby-version-specific configs provided by "standard" family of gems # Plus+: Ruby-version-specific configs that standard does not have ```What about TargetRubyVersion?
**Instead of using this gem, standard-rubocop-lts
, use rubocop-lts
, which depends on this gem.
# NOTE: Picking the right version of this rubocop-lts automatically aligns:
# - gemspec's required_ruby_version
# - RuboCop's TargetRubyVersion
# e.g. v18 for Ruby >= 2.7.0
gem "rubocop-lts", "~> 18.2.1", require: false
💻 Development
After checking out the repo, run bin/setup
to install dependencies.
Then, run rake spec
to run the tests w/ coverage,
or bin/rake
to run tests w/ coverage, and linting.
You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
.
🚀 Release Instructions
See CONTRIBUTING.md.
⚡️ Contributing
See CONTRIBUTING.md
🌈 Contributors
Made with contributors-img.
📄 License
The gem is available as open source under the terms of the MIT License . See LICENSE.txt for the official Copyright Notice.
Project Logos (standard-rubocop-lts)
See [docs/images/logo/README.txt][project-logos]Organization Logo (rubocop-lts)
Author: [Yusuf Evli][org-logo-author] Source: [Unsplash][org-logo-source] License: [Unsplash License][org-logo-license]© Copyright
- Copyright (c) 2023 Peter H. Boling of Rails Bling
🤝 Code of Conduct
Everyone interacting in this project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
📌 Versioning
This library aims to adhere to Semantic Versioning 2.0.0. Violations of this scheme should be reported as bugs. Specifically, if a minor or patch version is released that breaks backward compatibility, a new version should be immediately released that restores compatibility. Breaking changes to the public API will only be introduced with new major versions.
As a result of this policy, you can (and should) specify a dependency on this gem using the Pessimistic Version Constraint with two digits of precision.
For example:
spec.add_dependency "standard-rubocop-lts", "~> 1.0"