Skip to content

Instantly share code, notes, and snippets.

@phanviet
Created September 28, 2016 05:02
Show Gist options
  • Save phanviet/3c0e63299c0da886e8e6a33aa94a2b62 to your computer and use it in GitHub Desktop.
Save phanviet/3c0e63299c0da886e8e6a33aa94a2b62 to your computer and use it in GitHub Desktop.
.rubocop
inherit_from: .rubocop_todo.yml
AllCops:
Include:
- Rakefile
- config.ru
- lib/**/*.rake
Exclude:
- db/schema.rb
#################### Style ####################
Style/StringLiterals:
Enabled: false
Style/TrailingWhitespace:
Enabled: true
Style/ClassAndModuleChildren:
Enabled: false
Style/Documentation:
Enabled: false
#################### Metrics ####################
Metrics/AbcSize:
Max: 26
Metrics/LineLength:
Max: 112
Metrics/MethodLength:
Max: 16
##################### Performance ############################
# Use `casecmp` rather than `downcase ==`.
Performance/Casecmp:
Enabled: true
# Use `str.{start,end}_with?(x, ..., y, ...)` instead of
# `str.{start,end}_with?(x, ...) || str.{start,end}_with?(y, ...)`.
Performance/DoubleStartEndWith:
Enabled: true
# Use `strip` instead of `lstrip.rstrip`.
Performance/LstripRstrip:
Enabled: true
# Use `Range#cover?` instead of `Range#include?`.
Performance/RangeInclude:
Enabled: true
# Use `sort` instead of `sort_by { |x| x }`.
Performance/RedundantSortBy:
Enabled: true
# Use `start_with?` instead of a regex match anchored to the beginning of a
# string.
Performance/StartWith:
Enabled: true
# Use `tr` instead of `gsub` when you are replacing the same number of
# characters. Use `delete` instead of `gsub` when you are deleting
# characters.
Performance/StringReplacement:
Enabled: true
# Checks for `.times.map` calls.
Performance/TimesMap:
Enabled: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment