otto 1.6.0 → 2.0.0.pre2
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/workflows/ci.yml +3 -2
- data/.github/workflows/claude-code-review.yml +53 -0
- data/.github/workflows/claude.yml +49 -0
- data/.gitignore +3 -0
- data/.rubocop.yml +26 -344
- data/CHANGELOG.rst +131 -0
- data/CLAUDE.md +56 -0
- data/Gemfile +11 -4
- data/Gemfile.lock +38 -42
- data/README.md +2 -0
- data/bin/rspec +4 -4
- data/changelog.d/README.md +120 -0
- data/changelog.d/scriv.ini +5 -0
- data/docs/.gitignore +2 -0
- data/docs/migrating/v2.0.0-pre1.md +276 -0
- data/docs/migrating/v2.0.0-pre2.md +345 -0
- data/examples/.gitignore +1 -0
- data/examples/advanced_routes/README.md +33 -0
- data/examples/advanced_routes/app/controllers/handlers/async.rb +9 -0
- data/examples/advanced_routes/app/controllers/handlers/dynamic.rb +9 -0
- data/examples/advanced_routes/app/controllers/handlers/static.rb +9 -0
- data/examples/advanced_routes/app/controllers/modules/auth.rb +9 -0
- data/examples/advanced_routes/app/controllers/modules/transformer.rb +9 -0
- data/examples/advanced_routes/app/controllers/modules/validator.rb +9 -0
- data/examples/advanced_routes/app/controllers/routes_app.rb +232 -0
- data/examples/advanced_routes/app/controllers/v2/admin.rb +9 -0
- data/examples/advanced_routes/app/controllers/v2/config.rb +9 -0
- data/examples/advanced_routes/app/controllers/v2/settings.rb +9 -0
- data/examples/advanced_routes/app/logic/admin/logic/manager.rb +27 -0
- data/examples/advanced_routes/app/logic/admin/panel.rb +27 -0
- data/examples/advanced_routes/app/logic/analytics_processor.rb +25 -0
- data/examples/advanced_routes/app/logic/complex/business/handler.rb +27 -0
- data/examples/advanced_routes/app/logic/data_logic.rb +23 -0
- data/examples/advanced_routes/app/logic/data_processor.rb +25 -0
- data/examples/advanced_routes/app/logic/input_validator.rb +24 -0
- data/examples/advanced_routes/app/logic/nested/feature/logic.rb +27 -0
- data/examples/advanced_routes/app/logic/reports_generator.rb +27 -0
- data/examples/advanced_routes/app/logic/simple_logic.rb +25 -0
- data/examples/advanced_routes/app/logic/system/config/manager.rb +27 -0
- data/examples/advanced_routes/app/logic/test_logic.rb +23 -0
- data/examples/advanced_routes/app/logic/transform_logic.rb +23 -0
- data/examples/advanced_routes/app/logic/upload_logic.rb +23 -0
- data/examples/advanced_routes/app/logic/v2/logic/dashboard.rb +27 -0
- data/examples/advanced_routes/app/logic/v2/logic/processor.rb +27 -0
- data/examples/advanced_routes/app.rb +33 -0
- data/examples/advanced_routes/config.rb +23 -0
- data/examples/advanced_routes/config.ru +7 -0
- data/examples/advanced_routes/puma.rb +20 -0
- data/examples/advanced_routes/routes +167 -0
- data/examples/advanced_routes/run.rb +39 -0
- data/examples/advanced_routes/test.rb +58 -0
- data/examples/authentication_strategies/README.md +32 -0
- data/examples/authentication_strategies/app/auth.rb +68 -0
- data/examples/authentication_strategies/app/controllers/auth_controller.rb +29 -0
- data/examples/authentication_strategies/app/controllers/main_controller.rb +28 -0
- data/examples/authentication_strategies/config.ru +24 -0
- data/examples/authentication_strategies/routes +37 -0
- data/examples/basic/README.md +29 -0
- data/examples/basic/app.rb +7 -35
- data/examples/basic/routes +0 -9
- data/examples/mcp_demo/README.md +87 -0
- data/examples/mcp_demo/app.rb +29 -34
- data/examples/mcp_demo/config.ru +9 -60
- data/examples/security_features/README.md +46 -0
- data/examples/security_features/app.rb +23 -24
- data/examples/security_features/config.ru +8 -10
- data/lib/otto/core/configuration.rb +167 -0
- data/lib/otto/core/error_handler.rb +86 -0
- data/lib/otto/core/file_safety.rb +61 -0
- data/lib/otto/core/middleware_stack.rb +237 -0
- data/lib/otto/core/router.rb +184 -0
- data/lib/otto/core/uri_generator.rb +44 -0
- data/lib/otto/design_system.rb +7 -5
- data/lib/otto/env_keys.rb +114 -0
- data/lib/otto/helpers/base.rb +5 -21
- data/lib/otto/helpers/request.rb +10 -8
- data/lib/otto/helpers/response.rb +27 -4
- data/lib/otto/helpers/validation.rb +9 -7
- data/lib/otto/mcp/auth/token.rb +10 -9
- data/lib/otto/mcp/protocol.rb +24 -27
- data/lib/otto/mcp/rate_limiting.rb +8 -3
- data/lib/otto/mcp/registry.rb +7 -2
- data/lib/otto/mcp/route_parser.rb +10 -15
- data/lib/otto/mcp/{validation.rb → schema_validation.rb} +16 -11
- data/lib/otto/mcp/server.rb +45 -22
- data/lib/otto/response_handlers/auto.rb +39 -0
- data/lib/otto/response_handlers/base.rb +16 -0
- data/lib/otto/response_handlers/default.rb +16 -0
- data/lib/otto/response_handlers/factory.rb +39 -0
- data/lib/otto/response_handlers/json.rb +34 -0
- data/lib/otto/response_handlers/redirect.rb +25 -0
- data/lib/otto/response_handlers/view.rb +24 -0
- data/lib/otto/response_handlers.rb +9 -135
- data/lib/otto/route.rb +51 -55
- data/lib/otto/route_definition.rb +15 -18
- data/lib/otto/route_handlers/base.rb +121 -0
- data/lib/otto/route_handlers/class_method.rb +89 -0
- data/lib/otto/route_handlers/factory.rb +42 -0
- data/lib/otto/route_handlers/instance_method.rb +69 -0
- data/lib/otto/route_handlers/lambda.rb +59 -0
- data/lib/otto/route_handlers/logic_class.rb +93 -0
- data/lib/otto/route_handlers.rb +10 -405
- data/lib/otto/security/authentication/auth_strategy.rb +44 -0
- data/lib/otto/security/authentication/authentication_middleware.rb +140 -0
- data/lib/otto/security/authentication/failure_result.rb +44 -0
- data/lib/otto/security/authentication/route_auth_wrapper.rb +149 -0
- data/lib/otto/security/authentication/strategies/api_key_strategy.rb +40 -0
- data/lib/otto/security/authentication/strategies/noauth_strategy.rb +19 -0
- data/lib/otto/security/authentication/strategies/permission_strategy.rb +47 -0
- data/lib/otto/security/authentication/strategies/role_strategy.rb +57 -0
- data/lib/otto/security/authentication/strategies/session_strategy.rb +41 -0
- data/lib/otto/security/authentication/strategy_result.rb +337 -0
- data/lib/otto/security/authentication.rb +28 -282
- data/lib/otto/security/config.rb +14 -23
- data/lib/otto/security/configurator.rb +219 -0
- data/lib/otto/security/csrf.rb +8 -143
- data/lib/otto/security/middleware/csrf_middleware.rb +151 -0
- data/lib/otto/security/middleware/rate_limit_middleware.rb +54 -0
- data/lib/otto/security/middleware/validation_middleware.rb +252 -0
- data/lib/otto/security/rate_limiter.rb +86 -0
- data/lib/otto/security/rate_limiting.rb +10 -105
- data/lib/otto/security/validator.rb +8 -253
- data/lib/otto/static.rb +3 -0
- data/lib/otto/utils.rb +14 -0
- data/lib/otto/version.rb +3 -1
- data/lib/otto.rb +141 -498
- data/otto.gemspec +4 -2
- metadata +99 -18
- data/examples/dynamic_pages/app.rb +0 -115
- data/examples/dynamic_pages/config.ru +0 -30
- data/examples/dynamic_pages/routes +0 -21
- data/examples/helpers_demo/app.rb +0 -244
- data/examples/helpers_demo/config.ru +0 -26
- data/examples/helpers_demo/routes +0 -7
- data/lib/concurrent_cache_store.rb +0 -68
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b6215d43a8ce52d332bc046b6d51e8474c243e804bb146381fcd617fa8aebd1f
|
|
4
|
+
data.tar.gz: 7d73de1613bdd0f2450c2b3e16c8ef0b7020ce417f38b506c70c9b05d414d561
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4f04484aadab6fd972ecc261ed7da8291996e1623ae5df198b08550f82afa86e7d651beb7448d75b690b7505ae5d4d8443dd24c2a98bec7bb4621bcbb8b23950
|
|
7
|
+
data.tar.gz: bdfe655d0f597f92bfacaf89342aa0d026ecf2e89d1975ebc1835b2521a38f3bec8ba57cce94992ab0ac2eae4f01ce0080f849f82d08bb15e3473c8794fa9667
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -38,12 +38,13 @@ jobs:
|
|
|
38
38
|
experimental: true
|
|
39
39
|
|
|
40
40
|
steps:
|
|
41
|
-
- uses: actions/checkout@
|
|
41
|
+
- uses: actions/checkout@v5
|
|
42
42
|
- name: Set up Ruby
|
|
43
43
|
uses: ruby/setup-ruby@v1
|
|
44
|
+
continue-on-error: ${{ matrix.experimental }}
|
|
44
45
|
with:
|
|
45
46
|
ruby-version: ${{ matrix.ruby }}
|
|
46
|
-
bundler-cache:
|
|
47
|
+
bundler-cache: ${{ !matrix.experimental }}
|
|
47
48
|
|
|
48
49
|
- name: Setup tmate session
|
|
49
50
|
uses: mxschmitt/action-tmate@7b6a61a73bbb9793cb80ad69b8dd8ac19261834c # v3
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
name: Claude Code Review
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, synchronize]
|
|
6
|
+
# Optional: Only run on specific file changes
|
|
7
|
+
# paths:
|
|
8
|
+
# - "src/**/*.ts"
|
|
9
|
+
# - "src/**/*.tsx"
|
|
10
|
+
# - "src/**/*.js"
|
|
11
|
+
# - "src/**/*.jsx"
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
claude-review:
|
|
15
|
+
# Optional: Filter by PR author
|
|
16
|
+
# if: |
|
|
17
|
+
# github.event.pull_request.user.login == 'external-contributor' ||
|
|
18
|
+
# github.event.pull_request.user.login == 'new-developer' ||
|
|
19
|
+
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
|
|
20
|
+
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
permissions:
|
|
23
|
+
contents: read
|
|
24
|
+
pull-requests: read
|
|
25
|
+
issues: read
|
|
26
|
+
id-token: write
|
|
27
|
+
|
|
28
|
+
steps:
|
|
29
|
+
- name: Checkout repository
|
|
30
|
+
uses: actions/checkout@v5
|
|
31
|
+
with:
|
|
32
|
+
fetch-depth: 1
|
|
33
|
+
|
|
34
|
+
- name: Run Claude Code Review
|
|
35
|
+
id: claude-review
|
|
36
|
+
uses: anthropics/claude-code-action@v1
|
|
37
|
+
with:
|
|
38
|
+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
39
|
+
prompt: |
|
|
40
|
+
Please review this pull request and provide feedback on:
|
|
41
|
+
- Code quality and best practices
|
|
42
|
+
- Potential bugs or issues
|
|
43
|
+
- Performance considerations
|
|
44
|
+
- Security concerns
|
|
45
|
+
- Test coverage
|
|
46
|
+
|
|
47
|
+
Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
|
|
48
|
+
|
|
49
|
+
Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
|
|
50
|
+
|
|
51
|
+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
|
52
|
+
# or https://docs.anthropic.com/en/docs/claude-code/sdk#command-line for available options
|
|
53
|
+
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
name: Claude Code
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
issue_comment:
|
|
5
|
+
types: [created]
|
|
6
|
+
pull_request_review_comment:
|
|
7
|
+
types: [created]
|
|
8
|
+
issues:
|
|
9
|
+
types: [opened, assigned]
|
|
10
|
+
pull_request_review:
|
|
11
|
+
types: [submitted]
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
claude:
|
|
15
|
+
if: |
|
|
16
|
+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
|
|
17
|
+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
|
|
18
|
+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
|
|
19
|
+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
permissions:
|
|
22
|
+
contents: read
|
|
23
|
+
pull-requests: read
|
|
24
|
+
issues: read
|
|
25
|
+
id-token: write
|
|
26
|
+
actions: read # Required for Claude to read CI results on PRs
|
|
27
|
+
steps:
|
|
28
|
+
- name: Checkout repository
|
|
29
|
+
uses: actions/checkout@v5
|
|
30
|
+
with:
|
|
31
|
+
fetch-depth: 1
|
|
32
|
+
|
|
33
|
+
- name: Run Claude Code
|
|
34
|
+
id: claude
|
|
35
|
+
uses: anthropics/claude-code-action@v1
|
|
36
|
+
with:
|
|
37
|
+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
38
|
+
|
|
39
|
+
# This is an optional setting that allows Claude to read CI results on PRs
|
|
40
|
+
additional_permissions: |
|
|
41
|
+
actions: read
|
|
42
|
+
|
|
43
|
+
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
|
|
44
|
+
# prompt: 'Update the pull request description to include a summary of changes.'
|
|
45
|
+
|
|
46
|
+
# Optional: Add claude_args to customize behavior and configuration
|
|
47
|
+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
|
48
|
+
# or https://docs.anthropic.com/en/docs/claude-code/sdk#command-line for available options
|
|
49
|
+
# claude_args: '--model claude-opus-4-1-20250805 --allowed-tools Bash(gh pr:*)'
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
|
@@ -8,410 +8,92 @@
|
|
|
8
8
|
# refer to the RuboCop documentation:
|
|
9
9
|
# https://docs.rubocop.org/rubocop/cops.html
|
|
10
10
|
#
|
|
11
|
-
|
|
12
11
|
plugins:
|
|
12
|
+
- rubocop-rspec
|
|
13
13
|
- rubocop-performance
|
|
14
14
|
- rubocop-thread_safety
|
|
15
|
-
- rubocop-rspec
|
|
16
15
|
|
|
17
16
|
AllCops:
|
|
18
17
|
NewCops: enable
|
|
19
|
-
DisabledByDefault: false # flip to true for a good autocorrect time
|
|
20
18
|
UseCache: true
|
|
21
19
|
MaxFilesInCache: 100
|
|
22
20
|
TargetRubyVersion: 3.2
|
|
23
21
|
Exclude:
|
|
24
|
-
- "spec
|
|
22
|
+
- "spec/**/*"
|
|
25
23
|
- "vendor/**/*"
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
25
|
+
#
|
|
26
|
+
# Trailing commas
|
|
83
27
|
Style/TrailingCommaInHashLiteral:
|
|
84
|
-
Enabled: true
|
|
85
28
|
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
29
|
Enabled: true
|
|
110
|
-
AllowMultipleReturnValues: false
|
|
111
30
|
|
|
112
|
-
Style/
|
|
113
|
-
|
|
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:
|
|
31
|
+
Style/TrailingCommaInArrayLiteral:
|
|
32
|
+
EnforcedStyleForMultiline: comma
|
|
123
33
|
Enabled: true
|
|
124
|
-
MinBodyLength: 3
|
|
125
|
-
AllowConsecutiveConditionals: false
|
|
126
34
|
|
|
127
|
-
Style/
|
|
128
|
-
EnforcedStyle: brackets
|
|
35
|
+
Style/TrailingCommaInArguments:
|
|
129
36
|
Enabled: true
|
|
130
37
|
|
|
131
|
-
Style/
|
|
38
|
+
Style/TrailingCommaInBlockArgs:
|
|
132
39
|
Enabled: true
|
|
133
40
|
|
|
134
|
-
|
|
41
|
+
Lint/TrailingCommaInAttributeDeclaration:
|
|
135
42
|
Enabled: true
|
|
136
43
|
|
|
137
|
-
Naming/PredicateMethod:
|
|
138
|
-
Enabled: false
|
|
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
|
-
|
|
166
44
|
Gemspec/DeprecatedAttributeAssignment:
|
|
167
45
|
Enabled: true
|
|
168
46
|
|
|
169
47
|
Gemspec/DevelopmentDependencies:
|
|
170
48
|
Enabled: true
|
|
171
49
|
|
|
172
|
-
Layout/ElseAlignment:
|
|
173
|
-
Enabled: false
|
|
174
|
-
|
|
175
|
-
Layout/EndAlignment:
|
|
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
|
|
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
50
|
Layout/HashAlignment:
|
|
201
51
|
Enabled: true
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
52
|
+
EnforcedHashRocketStyle: key
|
|
53
|
+
EnforcedColonStyle: separator
|
|
54
|
+
EnforcedLastArgumentHashStyle: always_ignore # Changed from ignore_implicit
|
|
205
55
|
|
|
206
56
|
Lint/Void:
|
|
207
|
-
Enabled:
|
|
208
|
-
|
|
209
|
-
Lint/CopDirectiveSyntax:
|
|
210
|
-
Enabled: true
|
|
57
|
+
Enabled: false
|
|
211
58
|
|
|
212
|
-
# Offense count: 122
|
|
213
|
-
# Assignment Branch Condition size
|
|
214
59
|
Metrics/AbcSize:
|
|
215
60
|
Enabled: false
|
|
216
61
|
Max: 20
|
|
217
62
|
|
|
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:
|
|
232
|
-
Enabled: true
|
|
233
|
-
EnforcedStyle: with_fixed_indentation # with_first_argument, with_fixed_indentation
|
|
234
|
-
IndentationWidth: 2
|
|
235
|
-
|
|
236
|
-
Layout/EmptyLineAfterGuardClause:
|
|
237
|
-
Enabled: true
|
|
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
63
|
Metrics/ClassLength:
|
|
267
64
|
Enabled: true
|
|
268
|
-
Max:
|
|
65
|
+
Max: 200
|
|
66
|
+
|
|
67
|
+
Metrics/CyclomaticComplexity:
|
|
68
|
+
Enabled: false
|
|
269
69
|
|
|
270
|
-
# Offense count: non-0
|
|
271
70
|
Metrics/MethodLength:
|
|
272
71
|
Enabled: true
|
|
273
|
-
Max:
|
|
72
|
+
Max: 40
|
|
274
73
|
CountAsOne: ["method_call"]
|
|
275
74
|
|
|
276
75
|
Metrics/ModuleLength:
|
|
277
76
|
Enabled: true
|
|
278
|
-
Max:
|
|
77
|
+
Max: 250
|
|
279
78
|
CountAsOne: ["method_call"]
|
|
280
79
|
|
|
281
80
|
Performance/Size:
|
|
282
81
|
Enabled: true
|
|
283
|
-
Exclude:
|
|
284
|
-
|
|
285
|
-
Naming/AsciiIdentifiers:
|
|
286
|
-
Enabled: true
|
|
287
|
-
|
|
288
|
-
Metrics/CyclomaticComplexity:
|
|
289
|
-
Enabled: false
|
|
82
|
+
Exclude:
|
|
83
|
+
# - lib/example.rb
|
|
290
84
|
|
|
291
85
|
Style/NegatedIfElseCondition:
|
|
292
86
|
Enabled: true
|
|
293
87
|
|
|
294
|
-
|
|
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:
|
|
88
|
+
Naming/AsciiIdentifiers:
|
|
379
89
|
Enabled: false
|
|
380
90
|
|
|
381
|
-
|
|
382
|
-
Lint/RedundantCopDisableDirective:
|
|
383
|
-
Enabled: false
|
|
384
|
-
Lint/AssignmentInCondition:
|
|
91
|
+
Style/FrozenStringLiteralComment:
|
|
385
92
|
Enabled: false
|
|
386
93
|
|
|
387
|
-
|
|
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:
|
|
94
|
+
Naming/MemoizedInstanceVariableName:
|
|
401
95
|
Enabled: false
|
|
402
96
|
|
|
403
|
-
#
|
|
404
|
-
|
|
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:
|
|
97
|
+
# We use class instance vars sparingly at load time
|
|
98
|
+
ThreadSafety/ClassInstanceVariable:
|
|
417
99
|
Enabled: false
|