Skip to content

Commit 246267d

Browse files
committed
Configure Code Climate
1 parent b27bf48 commit 246267d

File tree

2 files changed

+144
-0
lines changed

2 files changed

+144
-0
lines changed

.codeclimate.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
engines:
3+
duplication:
4+
enabled: true
5+
config:
6+
languages:
7+
- ruby
8+
fixme:
9+
enabled: true
10+
rubocop:
11+
enabled: true
12+
ratings:
13+
paths:
14+
- "**.rb"
15+
exclude_paths:
16+
- config/
17+
- spec/

.rubocop.yml

+127
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
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+
Style/StringLiteralsInInterpolation:
29+
EnforcedStyle: double_quotes
30+
31+
# Use a trailing comma to keep diffs clean when elements are inserted or removed
32+
Style/TrailingCommaInArguments:
33+
EnforcedStyleForMultiline: comma
34+
35+
Style/TrailingCommaInLiteral:
36+
EnforcedStyleForMultiline: comma
37+
38+
# We avoid GuardClause because it can result in "suprise return"
39+
Style/GuardClause:
40+
Enabled: false
41+
42+
# We avoid IfUnlessModifier because it can result in "suprise if"
43+
Style/IfUnlessModifier:
44+
Enabled: false
45+
46+
# We don't care about the fail/raise distinction
47+
Style/SignalException:
48+
EnforcedStyle: only_raise
49+
50+
Style/DotPosition:
51+
EnforcedStyle: trailing
52+
53+
# Common globals we allow
54+
Style/GlobalVars:
55+
AllowedVariables:
56+
- "$statsd"
57+
- "$mongo"
58+
- "$rollout"
59+
60+
# Using english names requires loading an extra module, which is annoying, so
61+
# we prefer the perl names for consistency.
62+
Style/SpecialGlobalVars:
63+
EnforcedStyle: use_perl_names
64+
65+
# We have common cases where has_ and have_ make sense
66+
Style/PredicateName:
67+
Enabled: true
68+
NamePrefixBlacklist:
69+
- is_
70+
71+
# We use %w[ ], not %w( ) because the former looks like an array
72+
Style/PercentLiteralDelimiters:
73+
PreferredDelimiters:
74+
"%w": []
75+
"%W": []
76+
77+
# Allow "trivial" accessors when defined as a predicate? method
78+
Style/TrivialAccessors:
79+
AllowPredicates: true
80+
81+
Style/Next:
82+
Enabled: false
83+
84+
# We think it's OK to use the "extend self" module pattern
85+
Style/ModuleFunction:
86+
Enabled: false
87+
88+
# Disallow extra spacing for token alignment
89+
Style/ExtraSpacing:
90+
AllowForAlignment: false
91+
92+
################################################################################
93+
# Performance
94+
################################################################################
95+
96+
Performance/RedundantMerge:
97+
Enabled: false
98+
99+
################################################################################
100+
# Rails - disable things because we're primarily non-rails
101+
################################################################################
102+
103+
Rails/Delegate:
104+
Enabled: false
105+
106+
Rails/TimeZone:
107+
Enabled: false
108+
109+
################################################################################
110+
# Specs - be more lenient on length checks and block styles
111+
################################################################################
112+
113+
Metrics/ModuleLength:
114+
Exclude:
115+
- spec/**/*
116+
117+
Metrics/MethodLength:
118+
Exclude:
119+
- spec/**/*
120+
121+
Style/ClassAndModuleChildren:
122+
Exclude:
123+
- spec/**/*
124+
125+
Style/BlockDelimiters:
126+
Exclude:
127+
- spec/**/*

0 commit comments

Comments
 (0)