-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.coderabbit.yaml
More file actions
257 lines (238 loc) · 7.52 KB
/
.coderabbit.yaml
File metadata and controls
257 lines (238 loc) · 7.52 KB
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# CodeRabbit Configuration
# Configuration for code quality, security, and linting
# Linting configuration
lint:
# Dockerfile linting
dockerfile:
enabled: true
config:
rules:
hadolint:
DL3008: warning # Pin versions in apt-get install
DL3013: warning # Pin versions in pip install
DL4000: error # MAINTAINER is deprecated
DL3003: error # Use WORKDIR instead of cd
DL3007: warning # Using latest is discouraged
DL3015: error # Avoid additional packages
DL3018: warning # Pin versions in apk add
DL3020: error # Use COPY instead of ADD
DL3045: warning # COPY with more than 2 arguments
DL3059: error # Multiple consecutive RUN commands
# HTML linting (using HTMLHint)
html:
enabled: true
config:
rules:
'tagname-lowercase': true
'attr-lowercase': true
'attr-value-double-quotes': true
'spec-char-escape': true
'id-unique': true
'src-not-empty': true
'alt-require': true
'title-require': true
'doctype-first': true
'id-class-value': 'dash'
'inline-style-disabled': true
'inline-script-disabled': true
'space-tab-mixed-disabled': 'space'
'id-class-ad-disabled': true
'href-abs-or-rel': false
'attr-unsafe-chars': true
# CSS/SCSS linting (using Stylelint)
css:
enabled: true
config:
extends: 'stylelint-config-standard'
rules:
'at-rule-no-unknown': [true, {
ignoreAtRules: ['tailwind', 'apply', 'layer', 'variants', 'responsive', 'screen']
}]
'declaration-block-trailing-semicolon': 'always'
'no-descending-specificity': null
'selector-class-pattern': '^[a-z][a-zA-Z0-9]+$'
'selector-pseudo-class-no-unknown': [true, {
ignorePseudoClasses: ['global']
}]
'property-no-unknown': [true, {
ignoreProperties: ['composes']
}]
# Shell script linting (using ShellCheck)
shell:
enabled: true
config:
exclude:
- SC1090 # Can't follow non-constant source
- SC1091 # Not following
- SC2155 # Declare and assign separately
warning:
- SC2086 # Double quote to prevent globbing
- SC2006 # Use $(...) notation
- SC2016 # Expressions don't expand in single quotes
error:
- SC2181 # Check exit code directly
- SC2317 # Command appears to be unreachable
# Markdown linting
markdown:
enabled: true
config:
MD013: # Line length
line_length: 120
code_blocks: false
tables: false
MD033: # Inline HTML
allowed_elements: ['br', 'img', 'a', 'div', 'h1', 'h2', 'h3', 'p', 'b', 'i', 'u']
MD041: # First line should be a top-level heading
level: 1
MD047: # Files should end with a single newline
require: true
# Python linting (using Pylint)
python:
enabled: true
config:
master:
disable: 'C0114,C0115,C0116' # Disable docstring requirements
messages_control:
disable:
- 'C0103' # Invalid name
- 'R0903' # Too few public methods
- 'R0913' # Too many arguments
basic:
max-line-length: 120
format:
max-line-length: 120
design:
max-args: 6
max-locals: 15
max-returns: 6
max-statements: 50
similarity:
min-similarity-lines: 4
# JavaScript/TypeScript linting (ESLint)
javascript:
enabled: true
config:
extends:
- 'eslint:recommended'
- 'plugin:@typescript-eslint/recommended'
- 'plugin:react/recommended'
- 'plugin:react-hooks/recommended'
parser: '@typescript-eslint/parser'
parserOptions:
ecmaVersion: 2021,
sourceType: 'module',
ecmaFeatures:
jsx: true
settings:
react:
version: 'detect'
rules:
# Core rules
'no-console': 'warn',
'no-debugger': 'error',
'no-unused-vars': ['warn', { 'argsIgnorePattern': '^_', 'varsIgnorePattern': '^_' }],
'prefer-const': 'warn',
'eqeqeq': ['error', 'always'],
'no-eval': 'error',
'no-var': 'error',
'prefer-template': 'warn',
'template-curly-spacing': 'error',
'no-duplicate-imports': 'error',
'no-useless-constructor': 'warn',
'no-useless-rename': 'warn',
'rest-spread-spacing': 'error',
'semi': ['error', 'always'],
'quotes': ['error', 'single', { 'avoidEscape': true }],
'indent': ['error', 2, { 'SwitchCase': 1 }],
'comma-dangle': ['error', 'always-multiline'],
'object-curly-spacing': ['error', 'always'],
'array-bracket-spacing': ['error', 'never'],
'keyword-spacing': 'error',
'space-before-blocks': 'error',
'space-before-function-paren': ['error', 'never'],
'space-in-parens': ['error', 'never'],
'space-infix-ops': 'error',
'space-unary-ops': 'error',
'spaced-comment': 'warn',
'arrow-spacing': 'error',
'no-implied-eval': 'error',
'no-multi-spaces': 'error',
'no-multi-str': 'error',
'no-new-wrappers': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-throw-literal': 'error',
'no-unused-expressions': 'warn',
'no-useless-call': 'error',
'no-void': 'error',
'prefer-promise-reject-errors': 'error',
'radix': 'error',
'yoda': 'error',
# TypeScript specific
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': ['warn', { 'argsIgnorePattern': '^_', 'varsIgnorePattern': '^_' }],
# React specific
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'react/jsx-uses-react': 'off',
'react/jsx-uses-vars': 'error',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn'
review:
enabled: true
auto_submit: true
update_comment: true
comments:
show_code_suggestions: true
show_security_issues: true
show_performance_improvements: true
# Focus on source and test files only
files:
include:
- "src/**/*"
- "tests/**/*"
- "*.{js,ts,json,md}"
# Exclude common directories and files
exclude:
- "**/node_modules"
- "**/dist"
- "**/build"
- "**/*.min.*"
- "**/.git"
- "**/package-lock.json"
- "**/yarn.lock"
- "**/__pycache__/**"
# Security scanning
security:
enabled: true
dependency_check: true # Checks package.json for known vulnerabilities
secret_scanning: true # Looks for exposed secrets
# Basic PR quality checks
pr_size:
large_threshold: 500 # Warn if PR > 500 lines
xlarge_threshold: 1000 # Block if PR > 1000 lines
# Documentation checks
documentation:
require_updates: true
check_readme: true
# Simple custom rules
custom_rules:
- name: "Avoid console.log in production"
pattern: "console\\.(log|warn|error|info)"
message: "Consider using a proper logging library in production"
level: "warning"
# Ignore common directories
global_ignore:
- "**/node_modules"
- "**/dist"
- "**/build"
- "**/.git"
- "**/*.min.*"
- "**/__pycache__/**"
# Basic PR requirements
pr_description:
required: true
min_length: 200
require_issue_reference: true