otto 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +15 -0
- data/.github/workflows/ci.yml +34 -0
- data/.gitignore +1 -0
- data/.pre-commit-config.yaml +107 -0
- data/.pre-push-config.yaml +88 -0
- data/.rubocop.yml +365 -21
- data/Gemfile +1 -3
- data/Gemfile.lock +78 -46
- data/README.md +58 -2
- data/examples/basic/app.rb +20 -20
- data/examples/basic/config.ru +1 -1
- data/examples/dynamic_pages/app.rb +30 -30
- data/examples/dynamic_pages/config.ru +1 -1
- data/examples/helpers_demo/app.rb +244 -0
- data/examples/helpers_demo/config.ru +26 -0
- data/examples/helpers_demo/routes +7 -0
- data/examples/security_features/app.rb +90 -87
- data/examples/security_features/config.ru +19 -17
- data/lib/otto/design_system.rb +22 -22
- data/lib/otto/helpers/base.rb +27 -0
- data/lib/otto/helpers/request.rb +226 -9
- data/lib/otto/helpers/response.rb +85 -38
- data/lib/otto/route.rb +17 -12
- data/lib/otto/security/config.rb +132 -38
- data/lib/otto/security/csrf.rb +23 -27
- data/lib/otto/security/validator.rb +33 -30
- data/lib/otto/static.rb +1 -1
- data/lib/otto/version.rb +1 -25
- data/lib/otto.rb +171 -61
- data/otto.gemspec +11 -12
- metadata +15 -15
- data/.rubocop_todo.yml +0 -152
- data/VERSION.yml +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 746b45b9ceea5aed255a2d39e578f65bbf4438791bf61aad37641cbd4313c365
|
4
|
+
data.tar.gz: 8e61944be4c19656684c5630bf74024c3738d4ed6b8891686be4beb735aaaddd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bd4f87e1d824c2dc6683f6909db32e0e0a460b65a8d1646a35f2ac464a450d8804f72cacad60eae066601867f84b1d97c8bbccb02211ed43e5e408d8b269894
|
7
|
+
data.tar.gz: 999b4b96f74cace0b236dea4ef8f16607713a66960be3301b30b3f3e9e9e7f047b6381820cf701d5385afb10641537c2e1726993ff5c84ae75f6325eefe53cc8
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
3
|
+
# Please see the documentation for all configuration options:
|
4
|
+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
5
|
+
|
6
|
+
version: 2
|
7
|
+
updates:
|
8
|
+
- package-ecosystem: "github-actions"
|
9
|
+
directory: "/" # Location of package manifests
|
10
|
+
schedule:
|
11
|
+
interval: "weekly"
|
12
|
+
- package-ecosystem: "bundler"
|
13
|
+
directory: "/"
|
14
|
+
schedule:
|
15
|
+
interval: "weekly"
|
@@ -0,0 +1,34 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- main
|
7
|
+
|
8
|
+
pull_request:
|
9
|
+
|
10
|
+
workflow_dispatch:
|
11
|
+
|
12
|
+
permissions:
|
13
|
+
contents: read
|
14
|
+
|
15
|
+
jobs:
|
16
|
+
test:
|
17
|
+
timeout-minutes: 10
|
18
|
+
runs-on: ubuntu-24.04
|
19
|
+
name: "RSpec Tests (Ruby ${{ matrix.ruby }})"
|
20
|
+
strategy:
|
21
|
+
fail-fast: true
|
22
|
+
matrix:
|
23
|
+
ruby: ["3.2", "3.3", "3.4", "3.5"]
|
24
|
+
|
25
|
+
steps:
|
26
|
+
- uses: actions/checkout@v4
|
27
|
+
- name: Set up Ruby
|
28
|
+
uses: ruby/setup-ruby@v1
|
29
|
+
with:
|
30
|
+
ruby-version: ${{ matrix.ruby }}
|
31
|
+
bundler-cache: true
|
32
|
+
|
33
|
+
- name: Run RSpec tests
|
34
|
+
run: bundle exec rspec
|
data/.gitignore
CHANGED
@@ -0,0 +1,107 @@
|
|
1
|
+
##
|
2
|
+
# Pre-Commit Hooks Configuration
|
3
|
+
#
|
4
|
+
# Fast, lightweight code quality checks that run before each commit
|
5
|
+
#
|
6
|
+
# Setup:
|
7
|
+
# 1. Install pre-commit:
|
8
|
+
# $ pip install pre-commit
|
9
|
+
#
|
10
|
+
# 2. Install git hooks:
|
11
|
+
# $ pre-commit install
|
12
|
+
#
|
13
|
+
# Usage:
|
14
|
+
# Hooks run automatically on 'git commit'
|
15
|
+
#
|
16
|
+
# Manual commands:
|
17
|
+
# - Check all files:
|
18
|
+
# $ pre-commit run --all-files
|
19
|
+
#
|
20
|
+
# - Update hooks:
|
21
|
+
# $ pre-commit autoupdate
|
22
|
+
#
|
23
|
+
# - Reinstall after config changes:
|
24
|
+
# $ pre-commit install
|
25
|
+
#
|
26
|
+
# Best Practices:
|
27
|
+
# - Reinstall hooks after modifying this config
|
28
|
+
# - Commit config changes in isolation
|
29
|
+
# - Keep checks fast to maintain workflow
|
30
|
+
#
|
31
|
+
# Resources:
|
32
|
+
# - Docs: https://pre-commit.com
|
33
|
+
# - Available hooks: https://pre-commit.com/hooks.html
|
34
|
+
#
|
35
|
+
# Note: These lightweight checks maintain code quality without
|
36
|
+
# slowing down the local development process.
|
37
|
+
|
38
|
+
# Hook installation configuration
|
39
|
+
default_install_hook_types:
|
40
|
+
- pre-commit # Primary code quality checks
|
41
|
+
- prepare-commit-msg # Commit message preprocessing
|
42
|
+
- post-commit # Actions after successful commit
|
43
|
+
- post-checkout # Triggered after git checkout
|
44
|
+
- post-merge # Triggered after git merge
|
45
|
+
|
46
|
+
# Default execution stage
|
47
|
+
default_stages: [pre-commit]
|
48
|
+
|
49
|
+
# Avoid multiple sequential commit failures
|
50
|
+
fail_fast: false
|
51
|
+
|
52
|
+
# Ignore generated and dependency directories
|
53
|
+
exclude: "^$"
|
54
|
+
|
55
|
+
repos:
|
56
|
+
# Meta hooks: basic checks for pre-commit config itself
|
57
|
+
- repo: meta
|
58
|
+
hooks:
|
59
|
+
- id: check-hooks-apply
|
60
|
+
- id: check-useless-excludes
|
61
|
+
|
62
|
+
# Standard pre-commit hooks: lightweight, universal checks
|
63
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
64
|
+
rev: v5.0.0
|
65
|
+
hooks:
|
66
|
+
# Formatting and basic sanitization
|
67
|
+
- id: trailing-whitespace # Remove trailing whitespaces
|
68
|
+
- id: end-of-file-fixer # Ensure files end with newline
|
69
|
+
- id: check-merge-conflict # Detect unresolved merge conflicts
|
70
|
+
- id: detect-private-key # Warn about committing private keys
|
71
|
+
- id: check-added-large-files # Prevent committing oversized files
|
72
|
+
args: ["--maxkb=2500"] # 2.5MB file size threshold
|
73
|
+
- id: no-commit-to-branch # Prevent direct commits to critical branches
|
74
|
+
args: ["--branch", "main", "--branch", "rel/.*"]
|
75
|
+
|
76
|
+
# # Ruby code quality and style checks (using local bundler environment)
|
77
|
+
# - repo: local
|
78
|
+
# hooks:
|
79
|
+
# - id: rubocop
|
80
|
+
# name: RuboCop
|
81
|
+
# description: Ruby static code analyzer and formatter
|
82
|
+
# entry: eval "$(rbenv init -)" && bundle exec rubocop
|
83
|
+
# language: system
|
84
|
+
# files: \.rb$
|
85
|
+
# pass_filenames: false
|
86
|
+
# - repo: https://github.com/rubocop-hq/rubocop
|
87
|
+
# rev: v1.79.1 # Or your desired version
|
88
|
+
# hooks:
|
89
|
+
# - id: rubocop
|
90
|
+
# files: \.rb$
|
91
|
+
# pass_filenames: false
|
92
|
+
# additional_dependencies:
|
93
|
+
# - rubocop-rails # Example of an additional gem
|
94
|
+
# - rubocop-performance
|
95
|
+
# - rubocop-rspec
|
96
|
+
|
97
|
+
# Commit message issue tracking integration
|
98
|
+
- repo: https://github.com/avilaton/add-msg-issue-prefix-hook
|
99
|
+
rev: v0.0.12
|
100
|
+
hooks:
|
101
|
+
- id: add-msg-issue-prefix
|
102
|
+
stages: [prepare-commit-msg]
|
103
|
+
description: Automatically prefix commits with issue numbers
|
104
|
+
args:
|
105
|
+
- "--default="
|
106
|
+
- '--pattern=(?:i18n(?=\/)|[a-zA-Z0-9]{0,10}-?[0-9]{1,5})'
|
107
|
+
- "--template=[#{}]"
|
@@ -0,0 +1,88 @@
|
|
1
|
+
##
|
2
|
+
# Pre-Push Hooks Configuration
|
3
|
+
#
|
4
|
+
# Quality control checks that run before code is pushed to remote repositories
|
5
|
+
#
|
6
|
+
# Setup:
|
7
|
+
# 1. Install the pre-push hook:
|
8
|
+
# $ pre-commit install --hook-type pre-push
|
9
|
+
#
|
10
|
+
# 2. Install required dependencies:
|
11
|
+
# - Ruby + Rubocop
|
12
|
+
# - Node.js + ESLint
|
13
|
+
# - TypeScript compiler
|
14
|
+
#
|
15
|
+
# Usage:
|
16
|
+
# Hooks run automatically on 'git push'
|
17
|
+
#
|
18
|
+
# Manual execution:
|
19
|
+
# - Run all checks:
|
20
|
+
# $ pre-commit run --config .pre-push-config.yaml --all-files
|
21
|
+
#
|
22
|
+
# - Run single check:
|
23
|
+
# $ pre-commit run <hook-id> --config .pre-push-config.yaml
|
24
|
+
# Example: pre-commit run rubocop --config .pre-push-config.yaml
|
25
|
+
#
|
26
|
+
# Included Checks:
|
27
|
+
# - Full codebase linting (Rubocop, ESLint)
|
28
|
+
# - YAML/JSON validation
|
29
|
+
# - TypeScript type checking
|
30
|
+
# - Code style enforcement
|
31
|
+
# - Security vulnerability scanning
|
32
|
+
#
|
33
|
+
# Related Files:
|
34
|
+
# - .pre-commit-config.yaml: Lightweight pre-commit checks
|
35
|
+
# - Documentation: https://pre-commit.com
|
36
|
+
#
|
37
|
+
# Note: These intensive checks run before pushing to catch issues early
|
38
|
+
# but allow faster local development with lighter pre-commit hooks.
|
39
|
+
|
40
|
+
# Allow all failures to happen so they can be corrected in one go
|
41
|
+
fail_fast: false
|
42
|
+
|
43
|
+
# Skip generated/dependency directories
|
44
|
+
exclude: "^(vendor|node_modules|dist|build)/"
|
45
|
+
|
46
|
+
default_install_hook_types:
|
47
|
+
- pre-push
|
48
|
+
- push
|
49
|
+
|
50
|
+
default_stages: [push]
|
51
|
+
|
52
|
+
repos:
|
53
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
54
|
+
rev: v4.6.0
|
55
|
+
hooks:
|
56
|
+
- id: check-yaml
|
57
|
+
name: Validate YAML files
|
58
|
+
args: ["--allow-multiple-documents"]
|
59
|
+
files: \.(yaml|yml)$
|
60
|
+
|
61
|
+
- id: check-toml
|
62
|
+
name: Validate TOML files
|
63
|
+
files: \.toml$
|
64
|
+
|
65
|
+
- id: check-json
|
66
|
+
name: Validate JSON files
|
67
|
+
files: \.json$
|
68
|
+
|
69
|
+
- id: pretty-format-json
|
70
|
+
name: Format JSON files
|
71
|
+
args: ["--autofix", "--no-sort-keys"]
|
72
|
+
files: \.json$
|
73
|
+
|
74
|
+
- id: mixed-line-ending
|
75
|
+
name: Check line endings
|
76
|
+
args: [--fix=lf]
|
77
|
+
|
78
|
+
- id: check-case-conflict
|
79
|
+
name: Check for case conflicts
|
80
|
+
|
81
|
+
- id: check-executables-have-shebangs
|
82
|
+
name: Check executable shebangs
|
83
|
+
|
84
|
+
- id: check-shebang-scripts-are-executable
|
85
|
+
name: Check shebang scripts are executable
|
86
|
+
|
87
|
+
- id: forbid-submodules
|
88
|
+
name: Check for submodules
|
data/.rubocop.yml
CHANGED
@@ -8,66 +8,410 @@
|
|
8
8
|
# refer to the RuboCop documentation:
|
9
9
|
# https://docs.rubocop.org/rubocop/cops.html
|
10
10
|
#
|
11
|
-
# Running `rubocop --regenerate-todo` will update the todo file
|
12
|
-
# with the latest state of the onion (using the same options
|
13
|
-
# as those documented at the top of the todo file). This is
|
14
|
-
# useful for a gradual migration of the codebase.
|
15
|
-
#
|
16
|
-
inherit_from: .rubocop_todo.yml
|
17
11
|
|
18
12
|
plugins:
|
19
13
|
- rubocop-performance
|
20
14
|
- rubocop-thread_safety
|
15
|
+
- rubocop-rspec
|
21
16
|
|
22
17
|
AllCops:
|
23
18
|
NewCops: enable
|
19
|
+
DisabledByDefault: false # flip to true for a good autocorrect time
|
24
20
|
UseCache: true
|
25
21
|
MaxFilesInCache: 100
|
26
|
-
TargetRubyVersion: 3.
|
22
|
+
TargetRubyVersion: 3.2
|
27
23
|
Exclude:
|
28
|
-
- "
|
29
|
-
- "migrate/*.rb"
|
30
|
-
- "try/**/*"
|
31
|
-
- "try/*.rb"
|
24
|
+
- "spec/**/*.rb"
|
32
25
|
- "vendor/**/*"
|
33
26
|
|
27
|
+
Layout/CaseIndentation:
|
28
|
+
Enabled: true
|
29
|
+
EnforcedStyle: end # case, end
|
30
|
+
IndentOneStep: false
|
31
|
+
IndentationWidth: 2
|
32
|
+
|
33
|
+
Layout/CommentIndentation:
|
34
|
+
Enabled: true
|
35
|
+
|
36
|
+
Layout/MultilineMethodCallBraceLayout:
|
37
|
+
Enabled: true
|
38
|
+
EnforcedStyle: new_line # symmetrical, new_line, same_line
|
39
|
+
|
40
|
+
Layout/TrailingWhitespace:
|
41
|
+
Enabled: true
|
42
|
+
|
43
|
+
Layout/SpaceAroundEqualsInParameterDefault:
|
44
|
+
Enabled: true
|
45
|
+
|
46
|
+
Layout/SpaceAroundOperators:
|
47
|
+
Enabled: false
|
48
|
+
|
49
|
+
# Use parentheses around a logical expression if it makes easier to read.
|
50
|
+
Style/RedundantParentheses:
|
51
|
+
Enabled: false
|
52
|
+
|
53
|
+
Lint/UnusedMethodArgument:
|
54
|
+
Enabled: true
|
55
|
+
|
56
|
+
Lint/UselessAssignment:
|
57
|
+
Enabled: true
|
58
|
+
|
59
|
+
Lint/DuplicateBranch:
|
60
|
+
Enabled: true
|
61
|
+
IgnoreLiteralBranches: false
|
62
|
+
IgnoreConstantBranches: false
|
63
|
+
IgnoreDuplicateElseBranch: false
|
64
|
+
|
65
|
+
# Offense count: 3
|
66
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
67
|
+
Metrics/PerceivedComplexity:
|
68
|
+
Max: 20
|
69
|
+
|
70
|
+
# Offense count: 186
|
71
|
+
# Configuration parameters: AllowedConstants.
|
72
|
+
Style/Documentation:
|
73
|
+
Enabled: false
|
74
|
+
|
75
|
+
Style/RescueStandardError:
|
76
|
+
Enabled: true
|
77
|
+
EnforcedStyle: explicit
|
78
|
+
|
79
|
+
# When true: Use match? instead of =~ when MatchData is not used. True is preferred but not for autocorrection. Regexs are too picky. Need to manually check every time.
|
80
|
+
Performance/RegexpMatch:
|
81
|
+
Enabled: false
|
82
|
+
|
83
|
+
Style/TrailingCommaInHashLiteral:
|
84
|
+
Enabled: true
|
85
|
+
EnforcedStyleForMultiline: comma
|
86
|
+
|
87
|
+
Style/StringLiterals:
|
88
|
+
Enabled: true
|
89
|
+
EnforcedStyle: single_quotes
|
90
|
+
|
91
|
+
# The Style/DoubleNegation cop is disabled because double negation provides
|
92
|
+
# a concise, idiomatic way to convert values to boolean in Ruby. Alternative
|
93
|
+
# approaches like ternary expressions or comparison with nil create unnecessary
|
94
|
+
# verbosity without adding clarity. In cases where boolean coercion is the
|
95
|
+
# explicit intent, !! clearly communicates this purpose to other Ruby developers.
|
96
|
+
Style/DoubleNegation:
|
97
|
+
Enabled: false
|
98
|
+
|
99
|
+
# Offense count: non-0
|
100
|
+
Style/FormatString:
|
101
|
+
EnforcedStyle: format
|
102
|
+
Enabled: true
|
103
|
+
|
104
|
+
Style/FormatStringToken:
|
105
|
+
EnforcedStyle: unannotated
|
106
|
+
Enabled: true
|
107
|
+
|
108
|
+
Style/RedundantReturn:
|
109
|
+
Enabled: true
|
110
|
+
AllowMultipleReturnValues: false
|
111
|
+
|
112
|
+
Style/IfUnlessModifier:
|
113
|
+
Enabled: false
|
114
|
+
|
115
|
+
# We prefer `extend self` and `class << self`.
|
116
|
+
Style/ModuleFunction:
|
117
|
+
Enabled: true
|
118
|
+
AutoCorrect: false
|
119
|
+
EnforcedStyle: extend_self
|
120
|
+
|
121
|
+
# Prefer 3 line if/else over one-liner
|
122
|
+
Style/GuardClause:
|
123
|
+
Enabled: true
|
124
|
+
MinBodyLength: 3
|
125
|
+
AllowConsecutiveConditionals: false
|
126
|
+
|
127
|
+
Style/SymbolArray:
|
128
|
+
EnforcedStyle: brackets
|
129
|
+
Enabled: true
|
130
|
+
|
131
|
+
Style/StringLiteralsInInterpolation:
|
132
|
+
Enabled: true
|
133
|
+
|
134
|
+
Style/BlockDelimiters:
|
135
|
+
Enabled: true
|
136
|
+
|
137
|
+
Naming/PredicateMethod:
|
138
|
+
Enabled: true
|
139
|
+
Mode: "conservative"
|
140
|
+
AllowedMethods:
|
141
|
+
- validate!
|
142
|
+
- migrate
|
143
|
+
|
144
|
+
# We use class instance variables quite a bit, mostly for readonly values set
|
145
|
+
# at boot time. Except for our models with have redis-rb Redis instances
|
146
|
+
# connected on their associated db via ModelClass.dbclient. We're well aware
|
147
|
+
# so keeping this disabled reduces warning noise.
|
148
|
+
ThreadSafety/ClassInstanceVariable:
|
149
|
+
Enabled: false
|
150
|
+
|
151
|
+
Naming/RescuedExceptionsVariableName:
|
152
|
+
Enabled: true
|
153
|
+
PreferredName: ex # Default is 'e'
|
154
|
+
|
155
|
+
Naming/PredicatePrefix:
|
156
|
+
Enabled: true
|
157
|
+
ForbiddenPrefixes: [is_, has_, have_]
|
158
|
+
AllowedMethods: [
|
159
|
+
has_passphrase?, # correlates with the REST API field `has_passphrase`
|
160
|
+
]
|
161
|
+
|
162
|
+
Layout/MultilineMethodCallIndentation:
|
163
|
+
EnforcedStyle: indented
|
164
|
+
IndentationWidth: 2
|
165
|
+
|
34
166
|
Gemspec/DeprecatedAttributeAssignment:
|
35
167
|
Enabled: true
|
36
168
|
|
37
169
|
Gemspec/DevelopmentDependencies:
|
38
170
|
Enabled: true
|
39
171
|
|
40
|
-
Layout/
|
172
|
+
Layout/ElseAlignment:
|
41
173
|
Enabled: false
|
42
174
|
|
43
|
-
|
175
|
+
Layout/EndAlignment:
|
44
176
|
Enabled: false
|
177
|
+
# Severity: low
|
178
|
+
# SupportedStylesAlignWith: 2
|
179
|
+
# Leave commented out. When we set align with, endless "error occurred"
|
180
|
+
# EnforcedStyle: keyword # keyword, variable, start_of_line
|
45
181
|
|
182
|
+
Layout/ExtraSpacing:
|
183
|
+
Enabled: true
|
184
|
+
AllowForAlignment: true
|
185
|
+
AllowBeforeTrailingComments: true
|
186
|
+
ForceEqualSignAlignment: true
|
187
|
+
|
188
|
+
Layout/IndentationConsistency:
|
189
|
+
EnforcedStyle: indented_internal_methods
|
190
|
+
Enabled: true
|
191
|
+
|
192
|
+
Layout/IndentationWidth:
|
193
|
+
# We don't want to enforce indentation width because it's doing weird things
|
194
|
+
# with if/else statements that capture values. The `if` expression is aligned
|
195
|
+
# with the right side of the `test` but the `else` expression is aligned with
|
196
|
+
# the start of the line.
|
197
|
+
Width: 2
|
198
|
+
Enabled: false
|
199
|
+
|
200
|
+
Layout/HashAlignment:
|
201
|
+
Enabled: true
|
202
|
+
|
203
|
+
Layout/FirstHashElementIndentation:
|
204
|
+
Enabled: true
|
205
|
+
|
206
|
+
Lint/Void:
|
207
|
+
Enabled: true
|
208
|
+
|
209
|
+
Lint/CopDirectiveSyntax:
|
210
|
+
Enabled: true
|
211
|
+
|
212
|
+
# Offense count: 122
|
213
|
+
# Assignment Branch Condition size
|
46
214
|
Metrics/AbcSize:
|
47
215
|
Enabled: false
|
48
216
|
Max: 20
|
49
217
|
|
50
|
-
|
218
|
+
# Offense count: 217
|
219
|
+
Layout/LineLength:
|
220
|
+
Enabled: false
|
221
|
+
AllowHeredoc: true
|
222
|
+
AllowURI: true
|
223
|
+
URISchemes:
|
224
|
+
- https
|
225
|
+
IgnoreCopDirectives: true
|
226
|
+
AllowedPatterns: []
|
227
|
+
SplitStrings: false
|
228
|
+
Max: 100
|
229
|
+
|
230
|
+
# Align the arguments of a method call if they span more than one line.
|
231
|
+
Layout/ArgumentAlignment:
|
51
232
|
Enabled: true
|
52
|
-
|
233
|
+
EnforcedStyle: with_fixed_indentation # with_first_argument, with_fixed_indentation
|
234
|
+
IndentationWidth: 2
|
53
235
|
|
54
|
-
|
55
|
-
Enabled:
|
236
|
+
Layout/EmptyLineAfterGuardClause:
|
237
|
+
Enabled: true
|
56
238
|
|
239
|
+
Layout/EmptyLineBetweenDefs:
|
240
|
+
Enabled: true
|
241
|
+
|
242
|
+
Layout/EmptyLines:
|
243
|
+
Enabled: true
|
244
|
+
|
245
|
+
Layout/EmptyLinesAroundAccessModifier:
|
246
|
+
Enabled: true
|
247
|
+
|
248
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
249
|
+
Enabled: true
|
250
|
+
|
251
|
+
Layout/EmptyLinesAroundBlockBody:
|
252
|
+
Enabled: true
|
253
|
+
|
254
|
+
Layout/EmptyLinesAroundClassBody:
|
255
|
+
Enabled: true
|
256
|
+
|
257
|
+
Layout/EmptyLinesAroundExceptionHandlingKeywords:
|
258
|
+
Enabled: true
|
259
|
+
|
260
|
+
Layout/EmptyLinesAroundMethodBody:
|
261
|
+
Enabled: true
|
262
|
+
|
263
|
+
Layout/EmptyLinesAroundModuleBody:
|
264
|
+
Enabled: true
|
265
|
+
|
266
|
+
Metrics/ClassLength:
|
267
|
+
Enabled: true
|
268
|
+
Max: 350
|
269
|
+
|
270
|
+
# Offense count: non-0
|
57
271
|
Metrics/MethodLength:
|
58
272
|
Enabled: true
|
59
|
-
Max:
|
273
|
+
Max: 50
|
60
274
|
CountAsOne: ["method_call"]
|
61
275
|
|
62
276
|
Metrics/ModuleLength:
|
63
277
|
Enabled: true
|
64
|
-
Max:
|
278
|
+
Max: 350
|
65
279
|
CountAsOne: ["method_call"]
|
66
280
|
|
67
281
|
Performance/Size:
|
68
282
|
Enabled: true
|
69
|
-
Exclude:
|
70
|
-
|
283
|
+
Exclude: []
|
284
|
+
|
285
|
+
Naming/AsciiIdentifiers:
|
286
|
+
Enabled: true
|
287
|
+
|
288
|
+
Metrics/CyclomaticComplexity:
|
289
|
+
Enabled: false
|
71
290
|
|
72
291
|
Style/NegatedIfElseCondition:
|
73
292
|
Enabled: true
|
293
|
+
|
294
|
+
Style/TrailingCommaInArguments:
|
295
|
+
Enabled: true
|
296
|
+
EnforcedStyleForMultiline: comma
|
297
|
+
|
298
|
+
Style/TrailingCommaInArrayLiteral:
|
299
|
+
Enabled: true
|
300
|
+
EnforcedStyleForMultiline: comma
|
301
|
+
|
302
|
+
# Use #empty? when testing for objects of length 0.
|
303
|
+
Style/ZeroLengthPredicate:
|
304
|
+
Enabled: true
|
305
|
+
Safe: true
|
306
|
+
|
307
|
+
Style/MethodDefParentheses:
|
308
|
+
Enabled: true
|
309
|
+
|
310
|
+
Style/FrozenStringLiteralComment:
|
311
|
+
Enabled: true
|
312
|
+
EnforcedStyle: never
|
313
|
+
|
314
|
+
Style/SuperArguments:
|
315
|
+
Enabled: true
|
316
|
+
|
317
|
+
# Offense count: non-0
|
318
|
+
ThreadSafety/ClassAndModuleAttributes:
|
319
|
+
Description: Avoid mutating class and module attributes.
|
320
|
+
Enabled: true
|
321
|
+
ActiveSupportClassAttributeAllowed: false
|
322
|
+
|
323
|
+
ThreadSafety/DirChdir:
|
324
|
+
Description: Avoid using `Dir.chdir` due to its process-wide effect.
|
325
|
+
Enabled: true
|
326
|
+
AllowCallWithBlock: false
|
327
|
+
|
328
|
+
# Do not assign mutable objects to class instance variables.
|
329
|
+
ThreadSafety/MutableClassInstanceVariable:
|
330
|
+
Description:
|
331
|
+
Enabled: true
|
332
|
+
EnforcedStyle: literals # one of literals, strict
|
333
|
+
SafeAutoCorrect: false
|
334
|
+
|
335
|
+
# Avoid starting new threads. Let a framework like Sidekiq handle the threads.
|
336
|
+
ThreadSafety/NewThread:
|
337
|
+
Enabled: true
|
338
|
+
|
339
|
+
# Avoid instance variables in Rack middleware.
|
340
|
+
ThreadSafety/RackMiddlewareInstanceVariable:
|
341
|
+
Description:
|
342
|
+
Enabled: true
|
343
|
+
Include:
|
344
|
+
- lib/middleware/*.rb
|
345
|
+
- lib/middleware/onetime/*.rb
|
346
|
+
|
347
|
+
# Unsafe autocorrect:
|
348
|
+
Performance/MapCompact:
|
349
|
+
Enabled: false
|
350
|
+
Performance/StringInclude:
|
351
|
+
Enabled: false
|
352
|
+
Style/ClassAndModuleChildren:
|
353
|
+
Enabled: false
|
354
|
+
Style/GlobalStdStream:
|
355
|
+
Enabled: false
|
356
|
+
Style/HashConversion:
|
357
|
+
Enabled: false
|
358
|
+
Style/HashEachMethods:
|
359
|
+
Enabled: false
|
360
|
+
Style/IdenticalConditionalBranches:
|
361
|
+
Enabled: false
|
362
|
+
Style/MinMaxComparison:
|
363
|
+
Enabled: false
|
364
|
+
Style/MutableConstant:
|
365
|
+
Enabled: false
|
366
|
+
Style/NumericPredicate:
|
367
|
+
Enabled: false
|
368
|
+
Style/RaiseArgs:
|
369
|
+
Enabled: false
|
370
|
+
Style/RedundantInterpolation:
|
371
|
+
Enabled: false
|
372
|
+
Style/SafeNavigation:
|
373
|
+
Enabled: false
|
374
|
+
Style/SpecialGlobalVars:
|
375
|
+
Enabled: false
|
376
|
+
Style/StringConcatenation:
|
377
|
+
Enabled: false
|
378
|
+
Style/SymbolProc:
|
379
|
+
Enabled: false
|
380
|
+
|
381
|
+
# warnings
|
382
|
+
Lint/RedundantCopDisableDirective:
|
383
|
+
Enabled: false
|
384
|
+
Lint/AssignmentInCondition:
|
385
|
+
Enabled: false
|
386
|
+
|
387
|
+
# Manual corrections
|
388
|
+
Metrics/BlockLength:
|
389
|
+
Enabled: false
|
390
|
+
Metrics/BlockNesting:
|
391
|
+
Enabled: false
|
392
|
+
Metrics/ParameterLists:
|
393
|
+
Enabled: false
|
394
|
+
Naming/AccessorMethodName:
|
395
|
+
Enabled: false
|
396
|
+
Naming/MethodParameterName:
|
397
|
+
Enabled: false
|
398
|
+
Performance/CollectionLiteralInLoop:
|
399
|
+
Enabled: false
|
400
|
+
Style/OptionalBooleanParameter:
|
401
|
+
Enabled: false
|
402
|
+
|
403
|
+
# warnings
|
404
|
+
Lint/DuplicateMethods:
|
405
|
+
Enabled: false
|
406
|
+
Lint/UselessOr:
|
407
|
+
Enabled: false
|
408
|
+
Lint/UnreachableLoop:
|
409
|
+
Enabled: false
|
410
|
+
Lint/MissingCopEnableDirective:
|
411
|
+
Enabled: false
|
412
|
+
Lint/MissingSuper:
|
413
|
+
Enabled: false
|
414
|
+
Lint/EmptyFile:
|
415
|
+
Enabled: false
|
416
|
+
Lint/RescueException:
|
417
|
+
Enabled: false
|