Skip to content

Commit

Permalink
Fix rubocop Layout/ArgumentAlignment cop (mastodon#26060)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjankowski authored and audiodude committed Oct 23, 2023
1 parent 8fba434 commit e514206
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 34 deletions.
9 changes: 0 additions & 9 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ Bundler/OrderedGems:
Exclude:
- 'Gemfile'

# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: with_first_argument, with_fixed_indentation
Layout/ArgumentAlignment:
Exclude:
- 'config/initializers/cors.rb'
- 'config/initializers/session_store.rb'

# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
# SupportedHashRocketStyles: key, separator, table
Expand Down Expand Up @@ -841,6 +833,5 @@ Style/TrailingCommaInHashLiteral:
Style/WordArray:
Exclude:
- 'app/helpers/languages_helper.rb'
- 'config/initializers/cors.rb'
- 'spec/controllers/settings/imports_controller_spec.rb'
- 'spec/models/form/import_spec.rb'
32 changes: 11 additions & 21 deletions config/initializers/cors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,16 @@
allow do
origins '*'

resource '/.well-known/*',
headers: :any,
methods: [:get],
credentials: false
resource '/@:username',
headers: :any,
methods: [:get],
credentials: false
resource '/users/:username',
headers: :any,
methods: [:get],
credentials: false
resource '/api/*',
headers: :any,
methods: [:post, :put, :delete, :get, :patch, :options],
credentials: false,
expose: ['Link', 'X-RateLimit-Reset', 'X-RateLimit-Limit', 'X-RateLimit-Remaining', 'X-Request-Id']
resource '/oauth/token',
headers: :any,
methods: [:post],
credentials: false
with_options headers: :any, credentials: false do
with_options methods: [:get] do
resource '/.well-known/*'
resource '/@:username'
resource '/users/:username'
end
resource '/api/*',
expose: %w(Link X-RateLimit-Reset X-RateLimit-Limit X-RateLimit-Remaining X-Request-Id),
methods: %i(post put delete get patch options)
resource '/oauth/token', methods: [:post]
end
end
end
11 changes: 7 additions & 4 deletions config/initializers/session_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

# Be sure to restart your server when you modify this file.

Rails.application.config.session_store :cookie_store,
key: '_mastodon_session',
secure: false, # All cookies have their secure flag set by the force_ssl option in production
same_site: :lax
Rails
.application
.config
.session_store :cookie_store,
key: '_mastodon_session',
secure: false, # All cookies have their secure flag set by the force_ssl option in production
same_site: :lax

0 comments on commit e514206

Please sign in to comment.