Skip to content

Commit e5d6667

Browse files
committed
Configure RuboCop
1 parent d77a3e3 commit e5d6667

File tree

5 files changed

+66
-1
lines changed

5 files changed

+66
-1
lines changed

.rubocop.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
AllCops:
2+
RunRailsCops: true
3+
Include:
4+
- '**/config.ru'
5+
- '**/Rakefile'
6+
Exclude:
7+
- 'db/**/*'
8+
- 'ext/**/*'
9+
- 'tmp/**/*'
10+
11+
# Style
12+
13+
Style/Documentation:
14+
Enabled: false
15+
16+
# Metrics
17+
18+
Metrics/AbcSize:
19+
Enabled: false
20+
21+
Metrics/BlockNesting:
22+
Enabled: false
23+
24+
Metrics/ClassLength:
25+
Enabled: false
26+
27+
Metrics/CyclomaticComplexity:
28+
Enabled: false
29+
30+
Metrics/LineLength:
31+
Enabled: false
32+
33+
Metrics/MethodLength:
34+
Enabled: false
35+
36+
Metrics/ParameterLists:
37+
Enabled: false
38+
39+
Metrics/PerceivedComplexity:
40+
Enabled: false

Contributing.md

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ It may take some time to run whole test suite, thus while developing one
1010
may find beneficial to run just single test cases or tests from one
1111
file.
1212

13+
##### To run all code style validations
14+
`bundle exec rubocop`
15+
1316
##### To run all tests
1417
`rvmsudo rake spec`
1518

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@ group :development, :test do
4343
gem 'launchy' # for capybara's save_and_open_page
4444
gem 'railroady' # for doc/diagrams
4545
gem 'simplecov'
46+
gem 'rubocop', '~> 0.29.1', require: false
4647
end

Gemfile.lock

+15
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ GEM
3434
addressable (2.3.6)
3535
andand (1.3.3)
3636
arel (5.0.1.20140414130214)
37+
ast (2.0.0)
38+
astrolabe (1.3.0)
39+
parser (>= 2.2.0.pre.3, < 3.0)
3740
autoparse (0.3.3)
3841
addressable (>= 2.3.1)
3942
extlib (>= 0.9.15)
@@ -115,6 +118,8 @@ GEM
115118
multi_json (~> 1.3)
116119
multi_xml (~> 0.5)
117120
rack (~> 1.2)
121+
parser (2.2.0.3)
122+
ast (>= 1.1, < 3.0)
118123
pg (0.17.1)
119124
pghero (0.1.7)
120125
activerecord
@@ -124,6 +129,7 @@ GEM
124129
cliver (~> 0.3.1)
125130
multi_json (~> 1.0)
126131
websocket-driver (>= 0.2.0)
132+
powerpack (0.1.0)
127133
rack (1.5.2)
128134
rack-cors (0.2.9)
129135
rack-protection (1.5.3)
@@ -146,6 +152,7 @@ GEM
146152
activesupport (= 4.1.8)
147153
rake (>= 0.8.7)
148154
thor (>= 0.18.1, < 2.0)
155+
rainbow (2.0.0)
149156
rake (10.4.2)
150157
rdoc (4.2.0)
151158
json (~> 1.4)
@@ -177,7 +184,14 @@ GEM
177184
rspec-mocks (~> 3.1.0)
178185
rspec-support (~> 3.1.0)
179186
rspec-support (3.1.2)
187+
rubocop (0.29.1)
188+
astrolabe (~> 1.3)
189+
parser (>= 2.2.0.1, < 3.0)
190+
powerpack (~> 0.1)
191+
rainbow (>= 1.99.1, < 3.0)
192+
ruby-progressbar (~> 1.4)
180193
ruby-prof (0.12.2)
194+
ruby-progressbar (1.7.1)
181195
signet (0.6.0)
182196
addressable (~> 2.3)
183197
extlib (~> 0.9)
@@ -249,6 +263,7 @@ DEPENDENCIES
249263
rspec-activemodel-mocks (~> 1.0.0)
250264
rspec-core (~> 3.1.0)
251265
rspec-rails (~> 3.1.0)
266+
rubocop (~> 0.29.1)
252267
ruby-prof (~> 0.12.2)
253268
simplecov
254269
sprockets-rails

Installation.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ The following programs should be installed first: `ruby` (and `bundler` gem), `P
2222
7. Go to `ext/tmc-sandbox/web` and install dependencies with `bundle install`. Compile extensions with `rake ext` and run tests with `rvmsudo rake test`.
2323
8. Compile the other stuff in `ext` by doing `rake compile`
2424
9. Install [tmc-check](https://github.com/testmycode/tmc-check) by running `rvmsudo make rubygems install clean` in `ext/tmc-sandbox/uml/output/tmc-check`.
25-
10. Run the test suite with `rvmsudo rake spec`.
25+
10. Verify code style with `bundle exec rubocop`.
26+
11. Run the test suite with `rvmsudo rake spec`.
2627

2728
After you get the test suite to pass see [post-install instructions](#post-install-instructions).
2829

@@ -187,6 +188,11 @@ $ cd tmc-sandbox/uml/output/tmc-check
187188
$ rvmsudo make rubygems install clean
188189
```
189190

191+
#### Verify code style
192+
```bash
193+
$ bundle exec rubocop
194+
```
195+
190196
#### Run the test suite
191197
In the tmc-server root directory run
192198
```bash

0 commit comments

Comments
 (0)