Merged
Conversation
68d1c07 to
5538639
Compare
Co-authored-by: Tobias Maier <me@tobiasmaier.info>
Co-authored-by: Tobias Maier <me@tobiasmaier.info>
Co-authored-by: Tobias Maier <me@tobiasmaier.info>
Co-authored-by: Tobias Maier <me@tobiasmaier.info>
5538639 to
e33bcba
Compare
There was a problem hiding this comment.
Pull request overview
This PR fixes linting issues to comply with rubocop-github standards, inspired by PR #558. The changes include updating .rubocop.yml to use plugins: instead of require: for rubocop-performance, disabling Lint/RedundantCopDisableDirective for Ruby 2.7 compatibility, and removing several cop disables that are now consistently enforced across all supported Ruby versions.
Key changes:
- Standardized class method definitions from
class << selfblocks todef self.method_namesyntax - Added consistent spacing inside hash literal braces (
{ key: value }instead of{key: value}) - Replaced conditional assignment pattern from
unlessmodifier to||=operator - Updated
.rubocop.ymlto disableLint/RedundantCopDisableDirectivewhile enabling previously disabled style cops
Reviewed changes
Copilot reviewed 13 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
.rubocop.yml |
Changed require: to plugins: for rubocop-performance, removed previously disabled cops, added Lint/RedundantCopDisableDirective disable |
spec/spec_helper.rb |
Converted class << self to def self. syntax for test helper methods |
spec/lib/secure_headers_spec.rb |
Added spaces inside hash literal braces throughout test cases |
spec/lib/secure_headers/middleware_spec.rb |
Added spaces inside hash literal braces for cookie configuration tests |
spec/lib/secure_headers/headers/policy_management_spec.rb |
Fixed let (:default_opts) to let(:default_opts) |
spec/lib/secure_headers/headers/cookie_spec.rb |
Added spaces inside hash literal braces for cookie test configurations |
spec/lib/secure_headers/headers/content_security_policy_spec.rb |
Fixed let (:default_opts) and added spaces inside hash literal braces |
spec/lib/secure_headers/configuration_spec.rb |
Added spaces inside hash literal braces for configuration tests |
lib/secure_headers/headers/x_xss_protection.rb |
Converted class << self to def self. syntax |
lib/secure_headers/headers/x_permitted_cross_domain_policies.rb |
Converted class << self to def self. syntax |
lib/secure_headers/headers/x_frame_options.rb |
Converted class << self to def self. syntax |
lib/secure_headers/headers/x_download_options.rb |
Converted class << self to def self. syntax |
lib/secure_headers/headers/x_content_type_options.rb |
Converted class << self to def self. syntax |
lib/secure_headers/headers/strict_transport_security.rb |
Converted class << self to def self. syntax |
lib/secure_headers/headers/referrer_policy.rb |
Converted class << self to def self. syntax |
lib/secure_headers/headers/expect_certificate_transparency.rb |
Converted class << self to def self. syntax |
lib/secure_headers/headers/cookie.rb |
Converted class << self to def self. syntax |
lib/secure_headers/headers/clear_site_data.rb |
Converted class << self to def self. syntax |
lib/secure_headers.rb |
Changed conditional assignment from unless modifier to ` |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rei-moo
added a commit
that referenced
this pull request
Dec 16, 2025
Inspired by #558 with the addition of disabling `Lint/RedundantCopDisableDirective` in `.rubocop.yml` in order to prevent rubocop errors related to unknown cops for Ruby versions 2.7 and prior. --------- Co-authored-by: Tobias Maier <me@tobiasmaier.info>
rei-moo
added a commit
that referenced
this pull request
Dec 16, 2025
Inspired by #558 with the addition of disabling `Lint/RedundantCopDisableDirective` in `.rubocop.yml` in order to prevent rubocop errors related to unknown cops for Ruby versions 2.7 and prior. --------- Co-authored-by: Tobias Maier <me@tobiasmaier.info>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Inspired by #558 with the addition of disabling
Lint/RedundantCopDisableDirectivein.rubocop.ymlin order to prevent rubocop errors related to unknown cops for Ruby versions 2.7 and prior.