Skip to content

Commit 781802e

Browse files
committed
Add .codeclimate.yml and configs
1 parent 214aeec commit 781802e

File tree

3 files changed

+158
-0
lines changed

3 files changed

+158
-0
lines changed

.codeclimate.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
engines:
2+
bundler-audit:
3+
enabled: true
4+
rubocop:
5+
enabled: true
6+
fixme:
7+
enabled: true
8+
9+
ratings:
10+
paths:
11+
- bin/codeclimate-foodcritic
12+
- "**.rb"
13+
14+
exclude_paths:
15+
- doc/**/*
16+
- spec/**/*

.rubocop.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
inherit_from: base_rubocop.yml
2+
3+
AllCops:
4+
TargetRubyVersion: 2.2
5+
6+
Rails/Delegate:
7+
Enabled: true
8+
9+
Rails/TimeZone:
10+
Enabled: true
11+
12+
Style/GlobalVars:
13+
AllowedVariables:
14+
- $statsd
15+
- $mongo
16+
- $rollout
17+
- $drip
18+
- $redis
19+
20+

base_rubocop.yml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
################################################################################
2+
# Metrics
3+
################################################################################
4+
5+
Metrics/LineLength:
6+
Enabled: false
7+
8+
Metrics/AbcSize:
9+
Enabled: false
10+
11+
################################################################################
12+
# Style
13+
################################################################################
14+
15+
# Executables are conventionally named bin/foo-bar
16+
Style/FileName:
17+
Exclude:
18+
- bin/**/*
19+
20+
# We don't (currently) document our code
21+
Style/Documentation:
22+
Enabled: false
23+
24+
# Always use double-quotes to keep things simple
25+
Style/StringLiterals:
26+
EnforcedStyle: double_quotes
27+
28+
# Use a trailing comma to keep diffs clean when elements are inserted or removed
29+
Style/TrailingCommaInArguments:
30+
EnforcedStyleForMultiline: comma
31+
32+
Style/TrailingCommaInLiteral:
33+
EnforcedStyleForMultiline: comma
34+
35+
# We avoid GuardClause because it can result in "suprise return"
36+
Style/GuardClause:
37+
Enabled: false
38+
39+
# We avoid IfUnlessModifier because it can result in "suprise if"
40+
Style/IfUnlessModifier:
41+
Enabled: false
42+
43+
# We don't care about the fail/raise distinction
44+
Style/SignalException:
45+
EnforcedStyle: only_raise
46+
47+
Style/DotPosition:
48+
EnforcedStyle: trailing
49+
50+
# Common globals we allow
51+
Style/GlobalVars:
52+
AllowedVariables:
53+
- "$statsd"
54+
- "$mongo"
55+
- "$rollout"
56+
57+
# Allow $! in config/initializers
58+
Style/SpecialGlobalVars:
59+
Exclude:
60+
- config/initializers/**/*
61+
62+
# We have common cases where has_ and have_ make sense
63+
Style/PredicateName:
64+
Enabled: true
65+
NamePrefixBlacklist:
66+
- is_
67+
68+
# We use %w[ ], not %w( ) because the former looks like an array
69+
Style/PercentLiteralDelimiters:
70+
PreferredDelimiters:
71+
"%i": "[]"
72+
"%I": "[]"
73+
"%w": "[]"
74+
"%W": "[]"
75+
76+
# Allow "trivial" accessors when defined as a predicate? method
77+
Style/TrivialAccessors:
78+
AllowPredicates: true
79+
80+
Style/Next:
81+
Enabled: false
82+
83+
# We think it's OK to use the "extend self" module pattern
84+
Style/ModuleFunction:
85+
Enabled: false
86+
87+
################################################################################
88+
# Performance
89+
################################################################################
90+
91+
Performance/RedundantMerge:
92+
Enabled: false
93+
94+
################################################################################
95+
# Rails - disable things because we're primarily non-rails
96+
################################################################################
97+
98+
Rails/Delegate:
99+
Enabled: false
100+
101+
Rails/TimeZone:
102+
Enabled: false
103+
104+
################################################################################
105+
# Specs - be more lenient on length checks and block styles
106+
################################################################################
107+
108+
Metrics/ModuleLength:
109+
Exclude:
110+
- spec/**/*
111+
112+
Metrics/MethodLength:
113+
Exclude:
114+
- spec/**/*
115+
116+
Style/ClassAndModuleChildren:
117+
Exclude:
118+
- spec/**/*
119+
120+
Style/BlockDelimiters:
121+
Exclude:
122+
- spec/**/*

0 commit comments

Comments
 (0)