Last active
August 29, 2015 14:09
-
-
Save mipearson/417046bfeacc8d2fc5ad to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env ruby | |
changed = `git diff --numstat origin/master | awk '{ print $3 }' | grep -E '(\\.rb|\\.rake)$' | grep -v db/schema` | |
changed = changed.split("\n").select { |c| File.exist?(c) } | |
if changed.length > 0 | |
system "bundle exec rubocop #{ARGV.join(' ')} #{changed.join(' ')}" | |
else | |
puts "No changes." | |
end | |
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
AllCops: | |
Exclude: | |
- 'features/**' | |
- 'db/**' | |
RunRailsCops: true | |
AlignHash: | |
EnforcedLastArgumentHashStyle: always_ignore | |
AlignParameters: | |
Enabled: false | |
LineLength: | |
Max: 180 | |
ClassLength: | |
Enabled: true | |
Severity: refactor | |
Max: 300 | |
MethodLength: | |
Enabled: true | |
Max: 30 | |
Severity: refactor | |
CyclomaticComplexity: | |
Max: 10 | |
Severity: refactor | |
EndAlignment: | |
Enabled: false | |
StringLiterals: | |
Enabled: false | |
Documentation: | |
Enabled: false | |
PercentLiteralDelimiters: | |
PreferredDelimiters: | |
'%w': '{}' | |
MethodDefParentheses: | |
Enabled: false | |
PredicateName: | |
NamePrefixBlacklist: | |
- is_ | |
- have_ | |
IndentHash: | |
EnforcedStyle: consistent | |
# breaks using if blocks with assignments | |
IndentationWidth: | |
Enabled: false | |
CaseIndentation: | |
IndentWhenRelativeTo: end | |
FormatString: | |
Enabled: false | |
ActionFilter: | |
Enabled: false | |
# different methods calls that do exactly the same thing are a smell, regardless of semantics | |
SignalException: | |
EnforcedStyle: only_raise | |
# Files in lib/migrations are allowed to puts things | |
Rails/Output: | |
Exclude: | |
- lib/migrations/* | |
- script/* | |
Rails/DefaultScope: | |
Include: | |
- app/models/*.rb | |
- app/models/**/*.rb | |
Rails/HasAndBelongsToMany: | |
Enabled: false | |
Rails/ScopeArgs: | |
Include: | |
- app/models/*.rb | |
- app/models/**/*.rb | |
Rails/Validation: | |
Include: | |
- app/models/*.rb | |
- app/models/**/*.rb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment