-
Notifications
You must be signed in to change notification settings - Fork 2
/
.codeclimate.yml
207 lines (179 loc) · 4.97 KB
/
.codeclimate.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# This is our default .CodeClimate.yml, broken out by language. Uncomment the
# sections at the bottom that apply to your project. ACTION comments indicate
# places where config might need to be tweaked.
version: "2"
checks:
#----------------
# These maintainability checks are language independent and check against all languages
method-lines:
config:
threshold: 70
return-statements:
config:
threshold: 7
plugins:
# ---------------
# Cross-language plugins. Should always be on.
duplication: # Looks for similar and identical code blocks
enabled: true
config:
languages:
go:
java:
javascript:
php:
python:
python_version: 3 # ACTION Comment this out if using Python 2
ruby:
swift:
typescript:
checks:
Similar code:
# Kept triggering on package names in Golang so I'm disabling
enabled: false
fixme: # Flags any FIXME, TODO, BUG, XXX, HACK comments so they can be fixed
enabled: true
config:
strings:
- FIXME
- TODO
- HACK
- XXX
- BUG
exclude_patterns:
# Exclude `context.T O D O()` false positives
- "internal/configurationmanagers/kubernetes/"
- "internal/providers/kubernetessecrets/"
- "test/providers/kubernetessecrets/"
# ---------------
# Commonly-used languages - run time is minimal and all of these will work
# whether files of that language are found or not. In general, leave uncommented
# Markdown
markdownlint:
enabled: true
# ... CONFIG CONTENT ...
checks:
MD024:
enabled: false
MD032:
enabled: false
MD034:
enabled: false
# Go
gofmt:
enabled: true
golint:
enabled: false
exclude_patterns:
- "**/" # exclude all
- "!./cmd/" # unexclude just the ones we want to lint
- "!./internal/"
- "!./pkg/"
- "!./test/"
govet:
enabled: true
# Ruby
flog:
enabled: true
reek:
enabled: true
rubocop:
enabled: true
channel: rubocop-0-79 # As of March 10, 2020, rubocop 0.80.1 is the latest
# However, it does not work with CodeClimate - throws
# an Invalid JSON error.
# ACTION uncomment bundler-audit below if using Gemfile/Gemfile.lock
# ACTION uncomment brakeman below if using Rails
# Shell scripts
shellcheck:
enabled: true
checks:
# Disable 'Not following' check - it doesn't handle ". ./script.sh" properly
SC1091:
enabled: false
SC2148:
enabled: false
# ---------------
# Other languages - will work with or without language files present. Again,
# runtime is minimal, so OK to leave uncommented.
# CoffeeScript
coffeelint:
enabled: true
# CSS
csslint:
enabled: true
# Groovy
codenarc:
enabled: true
# Java
pmd:
enabled: true
sonar-java:
enabled: true
config:
sonar.java.source: "7" # ACTION set this to the major version of Java used
# ACTION uncomment checkstyle below if Java code exists in repo
# Node.js
nodesecurity:
enabled: true
# ACTION uncomment eslint below if JavaScript already exists and .eslintrc
# file exists in repo
# PHP
phan:
enabled: true
config:
file_extensions: "php"
phpcodesniffer:
enabled: true
config:
file_extensions: "php,inc,lib"
# Using Wordpress standards as our one PHP repo is a Wordpress theme
standards: "PSR1,PSR2,WordPress,WordPress-Core,WordPress-Extra"
phpmd:
enabled: true
config:
file_extensions: "php,inc,lib"
rulesets: "cleancode,codesize,controversial,naming,unusedcode"
sonar-php:
enabled: true
# Python
bandit:
enabled: true
pep8:
enabled: true
radon:
enabled: true
# config:
# python_version: 2 # ACTION Uncomment these 2 lines if using Python 2
sonar-python:
enabled: true
# ---------------
# Configuration Required Language specific - these will error and abort the
# codeclimate run if they are turned on and certain files or configuration are
# missing. Should be commented out unless the project already includes the
# necessary files that the linter looks at
# Ruby - requires presence of Gemfile and Gemfile.lock
# bundler-audit:
# enabled: true
# Rails - requires detecting a Rails application
# brakeman:
# enabled: true
# Chef - requires detecting a cookbook
# foodcritic:
# enabled: true
# Java - might require Java code? Errored when run without
# checkstyle:
# enabled: true
# JavaScript - requires an eslintrc to be created and added to project
# eslint:
# enabled: true
# channel: "eslint-6"
# ---------------
# List any files/folders to exclude from checking. Wildcards accepted. Leave
# commented if no files to exclude as an empty array will error
exclude_patterns:
- ".gitignore"
- "ci/conjur-hacks/*.rb"
- "pkg/clients/authn_oidc_dev.go"
# Exclude autogenerated code
- "pkg/k8sclient/"