Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import config for rubocop-rspec #75

Merged
merged 1 commit into from May 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .rubocop.yml
Expand Up @@ -2,7 +2,7 @@
inherit_from:
- ./config/default.yml
- ./config/rails.yml
- ./config/rake.yml
- ./config/rspec.yml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you meaning to remove the rake config from here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, forgot to mention it's included by default.


inherit_mode:
merge:
Expand Down
5 changes: 5 additions & 0 deletions config/capybara.yml
@@ -0,0 +1,5 @@
# Within GOV.UK we use Capybara test method syntax of feature,
# scenario. We don't want this outside of feature specs though.
Capybara/FeatureMethods:
Exclude:
- 'spec/features/**/*.rb'
37 changes: 37 additions & 0 deletions config/rspec.yml
@@ -0,0 +1,37 @@
require: rubocop-rspec

inherit_from:
- capybara.yml

# Analog of: 736b3d295f88b9ba6676fc168b823535582388c2
#
# We should avoid cops that are based on heuristics, since
# it's not clear what action to take to fix an issue.
RSpec/ExampleLength:
Enabled: false

# We have common cases, such as rake tasks, where we do not
# use a class to the describe the test.
RSpec/DescribeClass:
Enabled: false

# We accept multiple expectations (within reason), preferring
# them to running mulitple similar tests.
RSpec/MultipleExpectations:
Enabled: false

# Part of the GOV.UK feature style involves instance variables.
RSpec/InstanceVariable:
Exclude:
- 'spec/features/**/*.rb'

# In GOV.UK we quite often test that a class received a method.
RSpec/MessageSpies:
Enabled: false

# Analog of: 736b3d295f88b9ba6676fc168b823535582388c2
#
# We should avoid cops that are based on heuristics, since
# it's not clear what action to take to fix an issue.
RSpec/NestedGroups:
Enabled: false