Skip to content

Commit

Permalink
Add rubocop-rake & fix Rake/Desc violations
Browse files Browse the repository at this point in the history
Previously I was seeing the following output when running rubocop:

    Tip: Based on detected gems, the following RuboCop extension
    libraries might be helpful:
      * rubocop-rake (https://rubygems.org/gems/rubocop-rake)

    You can opt out of this message by adding the following to your
    config (see https://docs.rubocop.org/rubocop/extensions.html#extension-suggestions
    for more options):
      AllCops:
        SuggestExtensions: false
  • Loading branch information
floehopper committed Jan 1, 2025
1 parent d98375c commit 835caa2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
require:
- rubocop-rake

inherit_from: .rubocop_todo.yml

inherit_mode:
Expand Down
3 changes: 3 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ namespace 'test' do # rubocop:disable Metrics/BlockLength
end
end

desc 'Run linters'
task 'lint' do
if defined?(RuboCop::RakeTask)
RuboCop::RakeTask.new
Expand Down Expand Up @@ -132,10 +133,12 @@ if ENV['MOCHA_GENERATE_DOCS']
task.options = ['--title', "Mocha #{Mocha::VERSION}", '--fail-on-warning']
end

desc 'Ensure custom domain remains in place for docs on GitHub Pages'
task 'checkout_docs_cname' do
`git checkout docs/CNAME`
end

desc 'Ensure custom JavaScript files remain in place for docs on GitHub Pages'
task 'checkout_docs_js' do
`git checkout docs/js/app.js`
`git checkout docs/js/jquery.js`
Expand Down
1 change: 1 addition & 0 deletions gemfiles/Gemfile.rubocop
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ gemspec path: '../'

gem 'rake'
gem 'rubocop'
gem 'rubocop-rake'

0 comments on commit 835caa2

Please sign in to comment.