Skip to content
An extension of RuboCop focused on code performance checks.
Branch: master
Clone or download
koic Merge pull request #58 from wteuber/fix_typo_in_FixedSize_doc
Fix typo in FixedSize documentation
Latest commit c765e1c May 23, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci [Fix #52] Drop support for Ruby 2.2 May 9, 2019
.github Add .github templates Mar 13, 2019
config Remove several Performance cops Apr 5, 2019
lib Fix typo in FixedSize documentation May 22, 2019
manual Fix typo in FixedSize documentation May 22, 2019
spec [Fix #54] Fix `Performance/FixedSize` to accept const assign with som… May 15, 2019
tasks [Fix #52] Drop support for Ruby 2.2 May 9, 2019
.gitattributes Add changelog Mar 13, 2019
.gitignore Update .gitignore file Oct 11, 2018
.rspec Import RuboCop performance specs Oct 11, 2018
.rubocop.yml [Fix #52] Drop support for Ruby 2.2 May 9, 2019
.rubocop_todo.yml Suppress RuboCop offenses May 2, 2019
CHANGELOG.md [Fix #54] Fix `Performance/FixedSize` to accept const assign with som… May 15, 2019
CONTRIBUTING.md Add contribution guidelines Mar 13, 2019
Gemfile Use edge RuboCop core for development Apr 20, 2019
LICENSE.txt Add MIT license Oct 9, 2018
README.md Add gem version badge to README Apr 4, 2019
Rakefile Add `rake new_cop` task Mar 13, 2019
mkdocs.yml
readthedocs.yml Add readthedocs.yml Mar 14, 2019
rubocop-performance.gemspec [Fix #52] Drop support for Ruby 2.2 May 9, 2019

README.md

RuboCop Performance

Gem Version CircleCI

Performance optimization analysis for your projects, as an extension to RuboCop.

Installation

Just install the rubocop-performance gem

gem install rubocop-performance

or if you use bundler put this in your Gemfile

gem 'rubocop-performance'

Usage

You need to tell RuboCop to load the Performance extension. There are three ways to do this:

RuboCop configuration file

Put this into your .rubocop.yml.

require: rubocop-performance

Now you can run rubocop and it will automatically load the RuboCop Performance cops together with the standard cops.

Command line

rubocop --require rubocop-performance

Rake task

RuboCop::RakeTask.new do |task|
  task.requires << 'rubocop-performance'
end

The Cops

All cops are located under lib/rubocop/cop/performance, and contain examples/documentation.

In your .rubocop.yml, you may treat the Performance cops just like any other cop. For example:

Performance/Size:
  Exclude:
    - lib/example.rb

Contributing

Checkout the contribution guidelines.

License

rubocop-performance is MIT licensed. See the accompanying file for the full text.

You can’t perform that action at this time.