|
1 | | -# RuboCop config file |
2 | | -# Configure cops |
3 | | -# https://github.com/bbatsov/rubocop |
4 | | -# https://github.com/bbatsov/rubocop/blob/master/config/default.yml |
5 | | -# https://github.com/bbatsov/ruby-style-guide |
6 | | -# |
7 | | - |
| 1 | +--- |
| 2 | +require: rubocop-rspec |
8 | 3 | AllCops: |
| 4 | + DisplayCopNames: true |
| 5 | + TargetRubyVersion: '2.1' |
9 | 6 | Include: |
10 | | - - '**/*.gemspec' |
11 | | - - '**/*.rake' |
12 | | - - '**/Gemfile' |
13 | | - - '**/Puppetfile' |
14 | | - - '**/Rakefile' |
15 | | - - '**/Guardfile' |
| 7 | + - "./**/*.rb" |
16 | 8 | Exclude: |
17 | | - - 'modules/**/*' |
18 | | - - 'pkg/**/*' |
19 | | - - 'spec/fixtures/**/*' |
20 | | - - 'vendor/**/*' |
21 | | - DisplayCopNames: true |
22 | | - |
23 | | -#################### Layout ############################### |
24 | | - |
25 | | -# The shebang stuff at the top triggers this |
26 | | -Layout/LeadingCommentSpace: |
| 9 | + - bin/* |
| 10 | + - ".vendor/**/*" |
| 11 | + - Gemfile |
| 12 | + - Rakefile |
| 13 | + - pkg/**/* |
| 14 | + - spec/fixtures/**/* |
| 15 | + - vendor/**/* |
| 16 | +Metrics/LineLength: |
| 17 | + Description: People have wide screens, use them. |
| 18 | + Max: 200 |
| 19 | +RSpec/BeforeAfterAll: |
| 20 | + Description: Beware of using after(:all) as it may cause state to leak between tests. |
| 21 | + A necessary evil in acceptance testing. |
27 | 22 | Exclude: |
28 | | - - Puppetfile |
29 | | - |
30 | | -#################### Style ############################### |
31 | | - |
32 | | -# Cop supports --auto-correct. |
33 | | -# Configuration parameters: SupportedStyles. |
34 | | -# Support ruby 1.8.7 |
35 | | -Style/HashSyntax: |
36 | | - EnforcedStyle: hash_rockets |
37 | | - |
38 | | -#################### Metrics ############################### |
39 | | - |
| 23 | + - spec/acceptance/**/*.rb |
| 24 | +RSpec/HookArgument: |
| 25 | + Description: Prefer explicit :each argument, matching existing module's style |
| 26 | + EnforcedStyle: each |
| 27 | +Style/BlockDelimiters: |
| 28 | + Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to |
| 29 | + be consistent then. |
| 30 | + EnforcedStyle: braces_for_chaining |
| 31 | +Style/ClassAndModuleChildren: |
| 32 | + Description: Compact style reduces the required amount of indentation. |
| 33 | + EnforcedStyle: compact |
| 34 | +Style/EmptyElse: |
| 35 | + Description: Enforce against empty else clauses, but allow `nil` for clarity. |
| 36 | + EnforcedStyle: empty |
| 37 | +Style/FormatString: |
| 38 | + Description: Following the main puppet project's style, prefer the % format format. |
| 39 | + EnforcedStyle: percent |
| 40 | +Style/FormatStringToken: |
| 41 | + Description: Following the main puppet project's style, prefer the simpler template |
| 42 | + tokens over annotated ones. |
| 43 | + EnforcedStyle: template |
| 44 | +Style/Lambda: |
| 45 | + Description: Prefer the keyword for easier discoverability. |
| 46 | + EnforcedStyle: literal |
| 47 | +Style/RegexpLiteral: |
| 48 | + Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168 |
| 49 | + EnforcedStyle: percent_r |
| 50 | +Style/TernaryParentheses: |
| 51 | + Description: Checks for use of parentheses around ternary conditions. Enforce parentheses |
| 52 | + on complex expressions for better readability, but seriously consider breaking |
| 53 | + it up. |
| 54 | + EnforcedStyle: require_parentheses_when_complex |
| 55 | +Style/TrailingCommaInArguments: |
| 56 | + Description: Prefer always trailing comma on multiline argument lists. This makes |
| 57 | + diffs, and re-ordering nicer. |
| 58 | + EnforcedStyleForMultiline: comma |
| 59 | +Style/TrailingCommaInLiteral: |
| 60 | + Description: Prefer always trailing comma on multiline literals. This makes diffs, |
| 61 | + and re-ordering nicer. |
| 62 | + EnforcedStyleForMultiline: comma |
| 63 | +Style/SymbolArray: |
| 64 | + Description: Using percent style obscures symbolic intent of array's contents. |
| 65 | + EnforcedStyle: brackets |
| 66 | +RSpec/MessageSpies: |
| 67 | + EnforcedStyle: receive |
| 68 | +Style/CollectionMethods: |
| 69 | + Enabled: true |
| 70 | +Style/MethodCalledOnDoEndBlock: |
| 71 | + Enabled: true |
| 72 | +Style/StringMethods: |
| 73 | + Enabled: true |
| 74 | +Layout/EndOfLine: |
| 75 | + Enabled: false |
40 | 76 | Metrics/AbcSize: |
41 | | - # Ruduce this... Max: 15 |
42 | | - Max: 30 |
43 | | - |
| 77 | + Enabled: false |
| 78 | +Metrics/BlockLength: |
| 79 | + Enabled: false |
| 80 | +Metrics/ClassLength: |
| 81 | + Enabled: false |
44 | 82 | Metrics/CyclomaticComplexity: |
45 | | - # Ruduce this... Max: 6 |
46 | | - Max: 8 |
47 | | - |
48 | | -Metrics/LineLength: |
49 | | - # Ruduce this... Max: 80 |
50 | | - Max: 111 |
51 | | - |
| 83 | + Enabled: false |
52 | 84 | Metrics/MethodLength: |
53 | | - # Ruduce this... Max: 10 |
54 | | - Max: 28 |
55 | | - |
56 | | -Metrics/BlockLength: |
57 | 85 | Enabled: false |
58 | | - |
59 | | -##################### Bundler ############################## |
60 | | - |
61 | | -Bundler/DuplicatedGem: |
| 86 | +Metrics/ModuleLength: |
| 87 | + Enabled: false |
| 88 | +Metrics/ParameterLists: |
| 89 | + Enabled: false |
| 90 | +Metrics/PerceivedComplexity: |
| 91 | + Enabled: false |
| 92 | +RSpec/DescribeClass: |
| 93 | + Enabled: false |
| 94 | +RSpec/ExampleLength: |
| 95 | + Enabled: false |
| 96 | +RSpec/MessageExpectation: |
| 97 | + Enabled: false |
| 98 | +RSpec/MultipleExpectations: |
| 99 | + Enabled: false |
| 100 | +RSpec/NestedGroups: |
| 101 | + Enabled: false |
| 102 | +Style/AsciiComments: |
| 103 | + Enabled: false |
| 104 | +Style/IfUnlessModifier: |
| 105 | + Enabled: false |
| 106 | +Style/SymbolProc: |
62 | 107 | Enabled: false |
0 commit comments