Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Code style checking for RSpec files.

License

NotificationsYou must be signed in to change notification settings

rubocop/rubocop-rspec

Repository files navigation

Join the chat at https://gitter.im/rubocop-rspec/LobbyGem VersionCI

RSpec-specific analysis for your projects, as an extension toRuboCop.

Installation

Just install therubocop-rspec gem

gem install rubocop-rspec

or if you use bundler put this in yourGemfile

gem'rubocop-rspec',require:false

Upgrading to RuboCop RSpec v3.x

Read all the details in ourUpgrade to Version 3.x document.

Upgrading to RuboCop RSpec v2.x

Read all the details in ourUpgrade to Version 2.x document.

Usage

You need to tell RuboCop to load the RSpec extension. There are threeways to do this:

RuboCop configuration file

Put this into your.rubocop.yml.

plugins:rubocop-rspec

Alternatively, use the following array notation when specifying multiple extensions.

plugins:  -rubocop-other-extension  -rubocop-rspec

Now you can runrubocop and it will automatically load the RuboCop RSpeccops together with the standard cops.

Note

The plugin system is supported in RuboCop 1.72+. In earlier versions, userequire instead ofplugins.

Command line

rubocop --plugin rubocop-rspec

Rake task

RuboCop::RakeTask.newdo |task|task.plugins <<'rubocop-rspec'end

Code Climate

rubocop-rspec is available on Code Climate as part of the rubocop engine.Learn More.

Documentation

You can read more about RuboCop RSpec in itsofficial manual.

The Cops

All cops are located underlib/rubocop/cop/rspec, and containexamples/documentation.

In your.rubocop.yml, you may treat the RSpec cops just like any othercop. For example:

RSpec/SpecFilePathFormat:Exclude:    -spec/my_poorly_named_spec_file.rb

Contributing

Checkout thecontribution guidelines.

License

rubocop-rspec is MIT licensed.See the accompanying file forthe full text.

About

Code style checking for RSpec files.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Contributors159

Languages


[8]ページ先頭

©2009-2025 Movatter.jp