Skip to content

Commit

Permalink
DEV: Use rubocop-discourse gem to add custom chdir cop
Browse files Browse the repository at this point in the history
Followup to b27e009
  • Loading branch information
davidtaylorhq committed Nov 18, 2019
1 parent 6f9afde commit eaf6096
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 34 deletions.
8 changes: 8 additions & 0 deletions .rubocop.yml
@@ -1,3 +1,6 @@
require:
- rubocop-discourse

AllCops:
TargetRubyVersion: 2.4
DisabledByDefault: true
Expand Down Expand Up @@ -128,3 +131,8 @@ Style/Semicolon:

Style/RedundantReturn:
Enabled: true

DiscourseCops/NoChdir:
Enabled: true
Exclude:
- 'spec/**/*' # Specs are run sequentially, so chdir can be used
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -143,6 +143,7 @@ group :test, :development do
gem 'pry-nav'
gem 'byebug', require: ENV['RM_INFO'].nil?
gem 'rubocop', require: false
gem "rubocop-discourse", require: false
gem 'parallel_tests'
end

Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Expand Up @@ -348,6 +348,8 @@ GEM
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
rubocop-discourse (1.0.1)
rubocop (>= 0.69.0)
ruby-openid (2.7.0)
ruby-prof (0.17.0)
ruby-progressbar (1.10.0)
Expand Down Expand Up @@ -524,6 +526,7 @@ DEPENDENCIES
rspec-rails (= 4.0.0.beta2)
rtlit
rubocop
rubocop-discourse
ruby-prof
ruby-readability
rubyzip
Expand Down
34 changes: 0 additions & 34 deletions lib/rubocop/cop/discourse_cops.rb

This file was deleted.

2 comments on commit eaf6096

@discoursereviewbot
Copy link

Choose a reason for hiding this comment

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

Blake Erickson posted:

Looks like for the discourse_api gem travis is erroring out on rubocop because of this?

Running RuboCop...

cannot load such file -- rubocop-discourse

I was just able to get it to fail locally by running

gem uninstall rubocop-discourse

I don't really like that the solution to fix this is to add a development dependency to the discourse_api.gemspec, but maybe that is what we have to do?

@discoursereviewbot
Copy link

Choose a reason for hiding this comment

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

David Taylor posted:

Yeah, I think adding a dev dependency is what we will need to do

Please sign in to comment.