-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from pboling/bug/64-rakefile-bp
Rakefile Best Practices (& RuboCop)
- Loading branch information
Showing
13 changed files
with
479 additions
and
388 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
inherit_from: .rubocop_todo.yml | ||
|
||
inherit_gem: | ||
rubocop-lts: rubocop-lts1_8.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# This configuration was generated by | ||
# `rubocop --auto-gen-config` | ||
# on 2022-12-11 23:40:03 +0700 using RuboCop version 0.41.2. | ||
# The point is for the user to remove these configuration records | ||
# one by one as the offenses are removed from the code base. | ||
# Note that changes in the inspected code, or installation of new | ||
# versions of RuboCop, may require this file to be generated again. | ||
|
||
# Offense count: 1 | ||
Lint/ParenthesesAsGroupedExpression: | ||
Exclude: | ||
- 'spec/os_spec.rb' | ||
|
||
# Offense count: 2 | ||
Metrics/AbcSize: | ||
Max: 31 | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: CountComments. | ||
Metrics/ClassLength: | ||
Max: 234 | ||
|
||
# Offense count: 2 | ||
Metrics/CyclomaticComplexity: | ||
Max: 9 | ||
|
||
# Offense count: 22 | ||
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes. | ||
# URISchemes: http, https | ||
Metrics/LineLength: | ||
Max: 144 | ||
|
||
# Offense count: 6 | ||
# Configuration parameters: CountComments. | ||
Metrics/MethodLength: | ||
Max: 26 | ||
|
||
# Offense count: 3 | ||
Metrics/PerceivedComplexity: | ||
Max: 10 | ||
|
||
# Offense count: 1 | ||
# Cop supports --auto-correct. | ||
# Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. | ||
# SupportedStyles: ruby19, ruby19_no_mixed_keys, hash_rockets | ||
Style/HashSyntax: | ||
Exclude: | ||
- 'Rakefile' | ||
|
||
# Offense count: 2 | ||
Style/IfInsideElse: | ||
Exclude: | ||
- 'lib/os.rb' | ||
- 'spec/os_spec.rb' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
source "http://rubygems.org" | ||
# encoding: utf-8 | ||
source 'http://rubygems.org' | ||
|
||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,32 @@ | ||
require 'rubygems' if RUBY_VERSION < '1.9.0' | ||
# encoding: utf-8 | ||
# frozen_string_literal: true | ||
|
||
require 'rspec/core/rake_task' | ||
RSpec::Core::RakeTask.new(:spec) | ||
task :default => :spec | ||
# !/usr/bin/env rake | ||
|
||
require 'bundler/gem_tasks' | ||
|
||
begin | ||
require 'rspec/core/rake_task' | ||
RSpec::Core::RakeTask.new(:spec) | ||
rescue LoadError | ||
desc 'spec task stub' | ||
task :spec do | ||
warn 'rspec is disabled' | ||
end | ||
end | ||
desc 'alias test task to spec' | ||
task :test => :spec | ||
|
||
begin | ||
require 'rubocop/rake_task' | ||
RuboCop::RakeTask.new do |task| | ||
task.options = ['-D'] # Display the name of the failing cops | ||
end | ||
rescue LoadError | ||
desc 'rubocop task stub' | ||
task :rubocop do | ||
warn 'RuboCop is disabled' | ||
end | ||
end | ||
|
||
task default: %i[test rubocop] |
Oops, something went wrong.