Skip to content

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 issy.long@digital.cabinet-office.gov.uk

- 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 <issy.long@digital.cabinet-office.gov.uk>
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