Skip to content

Make generated spec/rails_helper.rb file compliant with RuboCop 0.80 #2280

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

Merged
merged 1 commit into from
Mar 4, 2020
Merged

Make generated spec/rails_helper.rb file compliant with RuboCop 0.80 #2280

merged 1 commit into from
Mar 4, 2020

Conversation

issyl0
Copy link
Contributor

@issyl0 issyl0 commented Mar 4, 2020

  • Over in @alphagov, we upgraded to RuboCop 0.80 which includes a new cop - Lint/NonDeterministicRequireOrder. This fails when linting this file:
spec/rails_helper.rb:20:1: W: Lint/NonDeterministicRequireOrder: Sort files before requiring them.
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
158 files inspected, 1 offense detected

Co-authored-by: Issy Long [email protected]

- Over in @alphagov, we upgraded to RuboCop 0.80 which includes a new
  cop - `Lint/NonDeterministicRequireOrder`. This fails when linting this
  file:

```
spec/rails_helper.rb:20:1: W: Lint/NonDeterministicRequireOrder: Sort files before requiring them.
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
158 files inspected, 1 offense detected
```

- While this is a generated file, [we decided to fix it in our projects
  anyway](alphagov/contacts-admin@715383a)
  everywhere we could, and push this fix upstream so that everyone gets it
  in hopefully a next release of `rspec-rails`.

Co-authored-by: Issy Long <[email protected]>
Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

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

Thanks!

@issyl0
Copy link
Contributor Author

issyl0 commented Mar 4, 2020

Looks like Travis had an issue installing gems on both the JRuby builds. 🤔

@pirj
Copy link
Member

pirj commented Mar 4, 2020

No worries, we'll handle that.

@JonRowe JonRowe merged commit ba6e397 into rspec:master Mar 4, 2020
@JonRowe
Copy link
Member

JonRowe commented Mar 4, 2020

Thanks, Jruby fixed elsewhere.

@issyl0 issyl0 deleted the make-generated-spec/rails_helper-rubocop-compliant branch March 4, 2020 18:12
@issyl0
Copy link
Contributor Author

issyl0 commented Mar 4, 2020

Thank you!

JonRowe added a commit that referenced this pull request Mar 13, 2020
…-rubocop-compliant

Make generated spec/rails_helper.rb file compliant with RuboCop 0.80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants