diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..e169310 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,104 @@ +# Configuration hierarchy: +# +# 1. Rubocop defaults +# 2. Carbon Five defaults (this file) +# 3. Project overrides +# +# See http://rubocop.readthedocs.io/en/latest/configuration/#inheriting-configuration-from-a-remote-url for details. +# + +AllCops: + DisplayCopNames: true + DisplayStyleGuide: true + +# +# Ruby Cops +# + +Layout/CaseIndentation: + Enabled: false + +Layout/FirstArrayElementIndentation: + EnforcedStyle: consistent + +Layout/HashAlignment: + Enabled: false + +Layout/LineLength: + Max: 120 + +Layout/MultilineMethodCallIndentation: + EnforcedStyle: indented + +Lint/AmbiguousBlockAssociation: + Enabled: false + +Lint/ScriptPermission: + Exclude: + - "Rakefile" + +Metrics/AbcSize: + Max: 35 + Exclude: + - "spec/**/*" + +Metrics/BlockLength: + CountComments: false + Max: 50 + Exclude: + - "config/**/*" + - "spec/**/*" + +Metrics/ClassLength: + Max: 250 + Exclude: + - "spec/**/*" + +Metrics/MethodLength: + Max: 25 + Exclude: + - "db/migrate/*" + - "spec/**/*" + +Naming/PredicateName: + Enabled: false + +Security/YAMLLoad: + Enabled: false + +Style/BarePercentLiterals: + EnforcedStyle: percent_q + +Style/BlockDelimiters: + EnforcedStyle: braces_for_chaining + +Style/Documentation: + Enabled: false + +Style/EmptyMethod: + EnforcedStyle: expanded + +Style/FrozenStringLiteralComment: + EnforcedStyle: never + +Style/Lambda: + EnforcedStyle: literal + +Style/ModuleFunction: + EnforcedStyle: extend_self + +Style/MutableConstant: + Enabled: false + +Style/PreferredHashMethods: + Enabled: false + +Style/StringLiterals: + EnforcedStyle: double_quotes + +Style/StringLiteralsInInterpolation: + EnforcedStyle: double_quotes + +Style/StructInheritance: + Enabled: true + diff --git a/Rakefile b/Rakefile index 2995527..3d7181d 100644 --- a/Rakefile +++ b/Rakefile @@ -1 +1,2 @@ require "bundler/gem_tasks" +Rake.add_rakelib "lib/tasks" diff --git a/bin/raygun b/bin/raygun index 53e7864..a9497e2 100755 --- a/bin/raygun +++ b/bin/raygun @@ -1,10 +1,10 @@ #!/usr/bin/env ruby -File.expand_path('../../lib', __FILE__).tap do |lib| +File.expand_path("../lib", __dir__).tap do |lib| $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) end -require 'raygun/raygun' +require "raygun/raygun" raygun = Raygun::Runner.parse(ARGV) diff --git a/lib/tasks/rubocop.rake b/lib/tasks/rubocop.rake new file mode 100644 index 0000000..86bf404 --- /dev/null +++ b/lib/tasks/rubocop.rake @@ -0,0 +1,3 @@ +require "rubocop/rake_task" + +RuboCop::RakeTask.new diff --git a/raygun.gemspec b/raygun.gemspec index 7c63440..8f06903 100644 --- a/raygun.gemspec +++ b/raygun.gemspec @@ -23,4 +23,5 @@ Gem::Specification.new do |gem| gem.add_development_dependency "bundler", "~> 2.0" gem.add_development_dependency "rake", "~> 13.0" + gem.add_development_dependency "rubocop", "~> 0.79" end