rubocop-csa 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +61 -0
- data/config/_layout.yml +55 -0
- data/config/_metrics.yml +14 -0
- data/config/_rspec.yml +13 -0
- data/config/_style.yml +73 -0
- data/config/default.yml +14 -0
- data/config/gems.yml +7 -0
- data/config/rails.yml +55 -0
- metadata +151 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f45498f4d55951d432a429026e94b206145d124c3139bcd50cc3a7b92ef90085
|
4
|
+
data.tar.gz: a3a9d0e80a52eab92324450293e61078a494bade1457bbebbefeae8357cb8dab
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1b758d20fcf367823cc3f383d5400dbfea99a496631db8d2d9b0dfdc11b7a29831048415ac6443959e81f0c90806a76e12aded9d90e6b31cde9b13fedcd70af2
|
7
|
+
data.tar.gz: c5f60f2ea5396b7adb17beb032ddfbf99fba303f1ca7c9d1877c0c67075ebda2f5556ed72394a2b6ba41c051721f3f2ee5d1eb1fcd07765295a52745f09a0932
|
data/README.md
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
# RuboCop CSA
|
2
|
+
|
3
|
+
Provides a centralized location for CSA's commonly used RuboCop overrides.
|
4
|
+
|
5
|
+
## TODO
|
6
|
+
|
7
|
+
- [ ] Add slim linting
|
8
|
+
- [ ] Investigate multi-line for shoulda matchers (`it { should`...)
|
9
|
+
|
10
|
+
## Usage
|
11
|
+
|
12
|
+
### Rails Applications
|
13
|
+
|
14
|
+
**Gemfile**
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
gem 'rubocop-csa'
|
18
|
+
gem 'rubocop-rails'
|
19
|
+
gem 'rubocop-rspec'
|
20
|
+
```
|
21
|
+
|
22
|
+
**.rubocop.yml**
|
23
|
+
|
24
|
+
```yaml
|
25
|
+
inherit_gem:
|
26
|
+
rubocop-csa:
|
27
|
+
- config/rails.yml
|
28
|
+
```
|
29
|
+
|
30
|
+
### Ruby Gems
|
31
|
+
|
32
|
+
**Gemfile**
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
gem 'rubocop-csa'
|
36
|
+
gem 'rubocop-rspec'
|
37
|
+
```
|
38
|
+
|
39
|
+
**.rubocop.yml**
|
40
|
+
|
41
|
+
```yaml
|
42
|
+
inherit_gem:
|
43
|
+
rubocop-csa:
|
44
|
+
- config/gems.yml
|
45
|
+
```
|
46
|
+
|
47
|
+
### Other Ruby code
|
48
|
+
|
49
|
+
**Gemfile**
|
50
|
+
|
51
|
+
```ruby
|
52
|
+
gem 'rubocop-csa'
|
53
|
+
```
|
54
|
+
|
55
|
+
**.rubocop.yml**
|
56
|
+
|
57
|
+
```yaml
|
58
|
+
inherit_gem:
|
59
|
+
rubocop-csa:
|
60
|
+
- config/default.yml
|
61
|
+
```
|
data/config/_layout.yml
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
##
|
2
|
+
# 80 Characters allows codebases to be more easily read in split screen mode,
|
3
|
+
# as well as on other sources such as terminal and Github.
|
4
|
+
#
|
5
|
+
# That said, one-line expectations in RSpec commonly exceed this limit, and the
|
6
|
+
# readability is significantly hindered when attempting to break these into
|
7
|
+
# multiple lines.
|
8
|
+
#
|
9
|
+
#
|
10
|
+
# CURRENTLY DISABLED
|
11
|
+
#
|
12
|
+
# LineLength affects other cops and it will take a ton of time to fix all the
|
13
|
+
# violations trying to get it to 80. Maybe we try this in the future, but a
|
14
|
+
# "best practice" approach seems best for now.
|
15
|
+
#
|
16
|
+
# Layout/LineLength:
|
17
|
+
# IgnoredPatterns: ['it { should', 'I18n.t']
|
18
|
+
# Max: 80
|
19
|
+
|
20
|
+
##
|
21
|
+
# Variable assignment can be indented weirdly, so align to the ending statement
|
22
|
+
# instead.
|
23
|
+
#
|
24
|
+
# If we hate this, remove it. (came from Josh's personal settings)
|
25
|
+
#
|
26
|
+
Layout/CaseIndentation:
|
27
|
+
EnforcedStyle: end
|
28
|
+
|
29
|
+
##
|
30
|
+
# It can be unclear if a line is truly ended unless the dot is on the method
|
31
|
+
# receiver.
|
32
|
+
#
|
33
|
+
Layout/DotPosition:
|
34
|
+
EnforcedStyle: trailing
|
35
|
+
|
36
|
+
##
|
37
|
+
# Lines can get stupidly long if we indent it to the other params/args.
|
38
|
+
#
|
39
|
+
Layout/ParameterAlignment:
|
40
|
+
EnforcedStyle: with_fixed_indentation
|
41
|
+
Layout/ArgumentAlignment:
|
42
|
+
EnforcedStyle: with_fixed_indentation
|
43
|
+
|
44
|
+
##
|
45
|
+
# Allow extra spaces when aligning to other operators...
|
46
|
+
# (doesn't seem to work all the time though)
|
47
|
+
#
|
48
|
+
Layout/SpaceAroundOperators:
|
49
|
+
AllowForAlignment: true
|
50
|
+
|
51
|
+
##
|
52
|
+
# Agreed in office to enforce outdent.
|
53
|
+
#
|
54
|
+
Layout/AccessModifierIndentation:
|
55
|
+
EnforcedStyle: outdent
|
data/config/_metrics.yml
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
##
|
2
|
+
# Similarly to migrations, spec blocks will be huge by design.
|
3
|
+
#
|
4
|
+
Metrics/BlockLength:
|
5
|
+
IgnoredMethods: ['describe', 'context']
|
6
|
+
Exclude:
|
7
|
+
- 'spec/support/webmock_stubs.rb'
|
8
|
+
|
9
|
+
# TODO: was live on CCSK, disabling to see if
|
10
|
+
# issue is resolved.
|
11
|
+
# This file had an issue with this cop:
|
12
|
+
# app/controllers/oauths_controller.rb
|
13
|
+
# Metrics/BlockNesting:
|
14
|
+
# Enabled: false
|
data/config/_rspec.yml
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
##
|
2
|
+
# `should` is shorter than `is_expected.to` and visually superior.
|
3
|
+
#
|
4
|
+
RSpec/ImplicitExpect:
|
5
|
+
EnforcedStyle: should
|
6
|
+
|
7
|
+
##
|
8
|
+
# RSpec wants "when this" type of formatting, but we group models via context by
|
9
|
+
# mechanisms.
|
10
|
+
#
|
11
|
+
RSpec/ContextWording:
|
12
|
+
Exclude:
|
13
|
+
- 'spec/models/**/*'
|
data/config/_style.yml
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
##
|
2
|
+
# ¯\_(ツ)_/¯
|
3
|
+
#
|
4
|
+
Style/AsciiComments:
|
5
|
+
AllowedChars: ['ツ', '¯']
|
6
|
+
|
7
|
+
##
|
8
|
+
# This cop suggests changes that are not functionally equivalent, and its value
|
9
|
+
# is currently debated within the ruby community.
|
10
|
+
#
|
11
|
+
# See: https://github.com/bbatsov/ruby-style-guide/issues/556
|
12
|
+
#
|
13
|
+
Style/ModuleFunction:
|
14
|
+
Enabled: false
|
15
|
+
|
16
|
+
##
|
17
|
+
# The readability of `[:some, :various, :symbols]` is superior to
|
18
|
+
# `%i[some various symbols]`
|
19
|
+
#
|
20
|
+
Style/SymbolArray:
|
21
|
+
EnforcedStyle: brackets
|
22
|
+
|
23
|
+
##
|
24
|
+
# Try and make rubocop follow our internal guidelines on hash styling...
|
25
|
+
#
|
26
|
+
Style/HashSyntax:
|
27
|
+
EnforcedStyle: ruby19_no_mixed_keys
|
28
|
+
UseHashRocketsWithSymbolValues: true
|
29
|
+
|
30
|
+
##
|
31
|
+
# Favor implicit returns for simple code, but feel free to use explicit return
|
32
|
+
# when it helps readability.
|
33
|
+
#
|
34
|
+
Style/RedundantReturn:
|
35
|
+
Enabled: false
|
36
|
+
|
37
|
+
##
|
38
|
+
# Official style guide wants %w[some group of words], but we don't care.
|
39
|
+
#
|
40
|
+
Style/WordArray:
|
41
|
+
Enabled: false
|
42
|
+
|
43
|
+
##
|
44
|
+
# Only require using "raise" outside of specs
|
45
|
+
# ("fail" is preferred in specs)
|
46
|
+
#
|
47
|
+
Style/SignalException:
|
48
|
+
Exclude:
|
49
|
+
- 'spec/**/*'
|
50
|
+
|
51
|
+
##
|
52
|
+
# Compact style is more compact, but is not functionally equivalent when the
|
53
|
+
# parent module has not yet been defined.
|
54
|
+
#
|
55
|
+
# e.g. This works:
|
56
|
+
#
|
57
|
+
# module CloudSecurityAlliance
|
58
|
+
# class Application < Rails::Application
|
59
|
+
# ...
|
60
|
+
# end
|
61
|
+
# end
|
62
|
+
#
|
63
|
+
# While this throws "Uninitialized constant CloudSecurityAlliance":
|
64
|
+
#
|
65
|
+
# class CloudSecurityAlliance::Application < Rails::Application
|
66
|
+
#
|
67
|
+
# Which could be corrected (ugily) by changing it to this:
|
68
|
+
#
|
69
|
+
# module CloudSecurityAlliance; end
|
70
|
+
# class CloudSecurityAlliance::Application < Rails::Application
|
71
|
+
#
|
72
|
+
Style/ClassAndModuleChildren:
|
73
|
+
Enabled: false
|
data/config/default.yml
ADDED
data/config/gems.yml
ADDED
data/config/rails.yml
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
inherit_from:
|
2
|
+
- default.yml
|
3
|
+
- _rspec.yml
|
4
|
+
|
5
|
+
require:
|
6
|
+
- rubocop-faker
|
7
|
+
- rubocop-rails
|
8
|
+
- rubocop-rspec
|
9
|
+
# We currently only translate on CCSK Platform
|
10
|
+
# - rubocop-i18n
|
11
|
+
|
12
|
+
AllCops:
|
13
|
+
Exclude:
|
14
|
+
####################################
|
15
|
+
## Folders that should be ignored ##
|
16
|
+
####################################
|
17
|
+
- 'bin/**/*'
|
18
|
+
- 'coverage/**/*'
|
19
|
+
- 'lib/templates/**/*'
|
20
|
+
- 'log/**/*'
|
21
|
+
- 'tmp/**/*'
|
22
|
+
- 'vendor/**/*'
|
23
|
+
- 'node_modules/**/*'
|
24
|
+
##########################
|
25
|
+
## Auto-generated files ##
|
26
|
+
##########################
|
27
|
+
# Generated by rails when running migrations
|
28
|
+
- 'db/schema.rb'
|
29
|
+
# Heroku injects this file during the build process and causes:
|
30
|
+
# Lint/UnneededCopDisableDirective: Unnecessary disabling of all cops.
|
31
|
+
- 'lib/tasks/heroku_clear_tasks'
|
32
|
+
|
33
|
+
##
|
34
|
+
# In the rest of the app, using the logger makes sense. However, it seems to
|
35
|
+
# not play nicely when generating the seeds, and `puts` is pretty
|
36
|
+
# straight-forward.
|
37
|
+
#
|
38
|
+
Rails/Output:
|
39
|
+
Exclude:
|
40
|
+
- 'db/seeds/*.rb'
|
41
|
+
- 'db/seeds.rb'
|
42
|
+
|
43
|
+
##
|
44
|
+
# This cop makes no sense in the context of migrations.
|
45
|
+
#
|
46
|
+
Metrics/AbcSize:
|
47
|
+
Exclude:
|
48
|
+
- 'db/migrate/*.rb'
|
49
|
+
|
50
|
+
##
|
51
|
+
# This cop makes no sense in the context of migrations.
|
52
|
+
#
|
53
|
+
Metrics/MethodLength:
|
54
|
+
Exclude:
|
55
|
+
- 'db/migrate/*.rb'
|
metadata
ADDED
@@ -0,0 +1,151 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rubocop-csa
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Cloud Security Alliance
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-06-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rubocop
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rubocop-performance
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rubocop-rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.6'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.6'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop-thread_safety
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.4'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.4'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '12.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '12.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop-faker
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop-rspec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '2.0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '2.0'
|
111
|
+
description: Provides a centralized location for CSA's commonly used RuboCop overrides.
|
112
|
+
email: support@cloudsecurityalliance.org
|
113
|
+
executables: []
|
114
|
+
extensions: []
|
115
|
+
extra_rdoc_files: []
|
116
|
+
files:
|
117
|
+
- README.md
|
118
|
+
- config/_layout.yml
|
119
|
+
- config/_metrics.yml
|
120
|
+
- config/_rspec.yml
|
121
|
+
- config/_style.yml
|
122
|
+
- config/default.yml
|
123
|
+
- config/gems.yml
|
124
|
+
- config/rails.yml
|
125
|
+
homepage: https://github.com/CloudSecurityAlliance/rubocop-csa
|
126
|
+
licenses:
|
127
|
+
- Apache-2.0
|
128
|
+
metadata:
|
129
|
+
bug_tracker_uri: https://github.com/CloudSecurityAlliance/rubocop-csa/issues
|
130
|
+
changelog_uri: https://github.com/CloudSecurityAlliance/rubocop-csa/releases/tag/v0.0.1
|
131
|
+
source_code_uri: https://github.com/CloudSecurityAlliance/rubocop-csa/tree/v0.0.1
|
132
|
+
post_install_message:
|
133
|
+
rdoc_options: []
|
134
|
+
require_paths:
|
135
|
+
- lib
|
136
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: 2.5.0
|
141
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
requirements: []
|
147
|
+
rubygems_version: 3.2.3
|
148
|
+
signing_key:
|
149
|
+
specification_version: 4
|
150
|
+
summary: RuboCop preferences for CSA
|
151
|
+
test_files: []
|