You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+55-18Lines changed: 55 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -46,10 +46,62 @@ NOTE: similar code will only work correctly if you run a diff on all the files i
46
46
- "**/__tests__/"
47
47
- "**/__mocks__/"
48
48
- "/.gitlab/"
49
-
- coverage/
49
+
- coverage/ . # simple cov
50
50
```
51
51
52
-
3. Install the gem
52
+
3. Add a `.reek.yml` config file eg:
53
+
54
+
See https://github.com/troessner/reek#working-with-rails
55
+
```
56
+
detectors:
57
+
IrresponsibleModule:
58
+
enabled: false
59
+
60
+
LongParameterList:
61
+
max_params: 4 # defaults to 3. You want this number realistic but stretchy so we can move it down
62
+
63
+
TooManyStatements:
64
+
max_statements: 10 # defaults to 5. You want this number realistic but stretchy so we can move it down
65
+
66
+
directories:
67
+
"app/controllers":
68
+
IrresponsibleModule:
69
+
enabled: false
70
+
NestedIterators:
71
+
max_allowed_nesting: 2
72
+
UnusedPrivateMethod:
73
+
enabled: false
74
+
InstanceVariableAssumption:
75
+
enabled: false
76
+
"app/helpers":
77
+
IrresponsibleModule:
78
+
enabled: false
79
+
UtilityFunction:
80
+
enabled: false
81
+
FeatureEnvy:
82
+
enabled: false
83
+
"app/mailers":
84
+
InstanceVariableAssumption:
85
+
enabled: false
86
+
"app/models":
87
+
InstanceVariableAssumption:
88
+
enabled: false
89
+
```
90
+
91
+
4. Add a `.codecimate_diff.yml` configuration file
92
+
```
93
+
main_branch_name: main
94
+
95
+
# settings to pull down the baseline from the pipeline in Gitlab before checking your branch
96
+
gitlab:
97
+
download_baseline_from_pipeline: true # If false or excluded, you will need to generate the baseline manually
98
+
project_id: '85'
99
+
host: https://gitlab.digitalnz.org/
100
+
baseline_filename: 'gl-code-quality-report.json'
101
+
```
102
+
103
+
104
+
4. Install the gem
53
105
54
106
Add this line to your application's Gemfile:
55
107
@@ -83,7 +135,7 @@ NOTE: similar code will only work correctly if you run a diff on all the files i
83
135
84
136
2. Do some work
85
137
86
-
3. Check if you've added any issues (about 10 secs per code file changed on your branch)
138
+
3. Check if you've added any issues (about 10 secs per code file changed on your branch):
87
139
88
140
```
89
141
# runs on all code files changed in your branch
@@ -101,21 +153,6 @@ NOTE: similar code will only work correctly if you run a diff on all the files i
101
153
```
102
154
4. Now you have time to fix the issues yay!
103
155
104
-
## Configuration
105
-
106
-
Example:
107
-
108
-
.codeclimate_diff.yml
109
-
110
-
```rb
111
-
gitlab:
112
-
main_branch_name: main
113
-
download_baseline_for_pipeline: true
114
-
project_id: '..'
115
-
host: https://gitlab.digitalnz.org/
116
-
personal_access_token: <LOAD FROM ENV VARIABLE>
117
-
```
118
-
119
156
## Development
120
157
121
158
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
0 commit comments