-
Notifications
You must be signed in to change notification settings - Fork 0
/
rubocop.yml
67 lines (56 loc) · 1.79 KB
/
rubocop.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
# Information for creating the rubocop.yml was taken from this location http://rubocop.readthedocs.io/en/latest/configuration/
# Rules are taken from rubystyle.guide, Azure, Airbnb's Ruby Style Guide and few top starred projects on Github.
require:
- rubocop-rails
- rubocop-rspec
- rubocop-performance
- rubocop-sequel
- rubocop-thread_safety
AllCops:
TargetRubyVersion: 2.5
DisplayCopNames: true
NewCops: enable
Exclude:
- node_modules/**/*
- bower_components/**/*
- vendor/**/*
# Too many voilations for Missing top-level documentation comment for class. This rule doesn't make sense to enforce.
# Airbnb recommends it but Ruby Style guide says no comments. They recommend self-documenting code.
Style/Documentation:
Enabled: false
# This doesn't look like our style. e.g: Use @minute.zero? instead of @minute == 0.
Style/NumericPredicate:
Enabled: false
# Picked from Airbnb Style Guide
Layout/EmptyLinesAroundBlockBody:
EnforcedStyle: no_empty_lines
# Picked from Airbnb Style Guide. Rationale: https://rubystyle.guide/#max-line-length
Layout/LineLength:
Max: 120
# This doesn't look like our style.
Style/FrozenStringLiteralComment:
Enabled: false
Metrics/MethodLength:
Max: 40
# The guiding principle of classes is SRP, SRP can't be accurately measured by LoC
Metrics/ClassLength:
Max: 1000
Metrics/AbcSize:
Max: 50
Metrics/CyclomaticComplexity:
Max: 20
Metrics/PerceivedComplexity:
Max: 20
Metrics/BlockLength:
Max: 35
Metrics/ModuleLength:
Max: 500
Style/SafeNavigation:
Enabled: false
# https://rubystyle.guide/#empty-lines-between-methods
Layout/EmptyLineBetweenDefs:
NumberOfEmptyLines: 1
# No space makes the method definition shorter and differentiates
# from a regular assignment.
Layout/SpaceAroundEqualsInParameterDefault:
EnforcedStyle: no_space