generated from saltstack-formulas/template-formula
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.rubocop.yml
148 lines (140 loc) · 3.91 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
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
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
AllCops:
RubyInterpreters:
- ruby
- macruby
- rake
- jruby
- rbx
# Include common Ruby source files.
Include:
- "**/*.rb"
- "**/*.arb"
- "**/*.axlsx"
- "**/*.builder"
- "**/*.fcgi"
- "**/*.gemfile"
- "**/*.gemspec"
- "**/*.god"
- "**/*.jb"
- "**/*.jbuilder"
- "**/*.mspec"
- "**/*.opal"
- "**/*.pluginspec"
- "**/*.podspec"
- "**/*.rabl"
- "**/*.rake"
- "**/*.rbuild"
- "**/*.rbw"
- "**/*.rbx"
- "**/*.ru"
- "**/*.ruby"
- "**/*.spec"
- "**/*.thor"
- "**/*.watchr"
- "**/.irbrc"
- "**/.pryrc"
- "**/buildfile"
- "**/Appraisals"
- "**/Berksfile"
- "**/Brewfile"
- "**/Buildfile"
- "**/Capfile"
- "**/Cheffile"
- "**/Dangerfile"
- "**/Deliverfile"
- "**/Fastfile"
- "**/*Fastfile"
- "**/Gemfile"
- "**/Guardfile"
- "**/Jarfile"
- "**/Mavenfile"
- "**/Podfile"
- "**/Puppetfile"
- "**/Rakefile"
- "**/Snapfile"
- "**/Steepfile"
- "**/Thorfile"
- "**/Vagabondfile"
- "**/Vagrantfile"
Exclude:
- "node_modules/**/*"
- "tmp/**/*"
- "vendor/**/*"
- ".git/**/*"
- "test/kitchen/**/*"
- "test/integration/**/*.rb"
- "test/fixtures/profiles/**/*.rb"
- "test/fixtures/config_dirs/**/*.rb"
- "lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/**/*"
- "examples/**/controls/*.rb"
- "vendor/bundle/**/*"
# DisplayCopNames: true
# DisplayStyleGuide: true
# ExtraDetails: true
Layout/ArgumentAlignment:
EnforcedStyle: with_first_argument
# General overrides used across formulas in the org
Layout/LineLength:
# Increase from default of `80`
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
Max: 120
# Too short methods lead to extraction of single-use methods, which can make
# the code easier to read (by naming things), but can also clutter the class
Metrics/MethodLength:
Max: 20
# The guiding principle of classes is SRP, SRP can't be accurately measured by LoC
Metrics/ClassLength:
Max: 1500
Metrics/BlockLength:
Description: "Avoid long blocks with many lines."
Enabled: true
CountComments: false
# count full line comments?
Max: 35
ExcludedMethods:
# default, exclude the `#refine` method, as it tends to have larger
# associated blocks.
- refine
Exclude:
- "**/*.gemspec"
# Any offenses that should be fixed, e.g. collected via. `rubocop --auto-gen-config`
#################### Security ##############################
Security/Eval:
Description: "The use of eval represents a serious security risk."
Enabled: true
VersionAdded: "0.47"
Security/JSONLoad:
Description: >-
Prefer usage of `JSON.parse` over `JSON.load` due to potential
security issues. See reference for more information.
Reference: "https://ruby-doc.org/stdlib-2.3.0/libdoc/json/rdoc/JSON.html#method-i-load"
Enabled: true
VersionAdded: "0.43"
VersionChanged: "0.44"
# Autocorrect here will change to a method that may cause crashes depending
# on the value of the argument.
AutoCorrect: false
SafeAutoCorrect: false
Security/MarshalLoad:
Description: >-
Avoid using of `Marshal.load` or `Marshal.restore` due to potential
security issues. See reference for more information.
Reference: "https://ruby-doc.org/core-2.3.3/Marshal.html#module-Marshal-label-Security+considerations"
Enabled: true
VersionAdded: "0.47"
Security/Open:
Description: "The use of Kernel#open represents a serious security risk."
Enabled: true
VersionAdded: "0.53"
Safe: false
Security/YAMLLoad:
Description: >-
Prefer usage of `YAML.safe_load` over `YAML.load` due to potential
security issues. See reference for more information.
Reference: "https://ruby-doc.org/stdlib-2.3.3/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security"
Enabled: true
VersionAdded: "0.47"
SafeAutoCorrect: false