Skip to content

Conversation

@rei-moo
Copy link
Contributor

@rei-moo rei-moo commented Dec 12, 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.

@rei-moo rei-moo force-pushed the rei-moo/lint branch 3 times, most recently from 68d1c07 to 5538639 Compare December 12, 2025 16:39
rei-moo and others added 4 commits December 12, 2025 16:56
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>
@rei-moo rei-moo requested a review from a team December 12, 2025 17:01
@rei-moo rei-moo marked this pull request as ready for review December 12, 2025 17:02
Copilot AI review requested due to automatic review settings December 12, 2025 17:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 << self blocks to def self.method_name syntax
  • Added consistent spacing inside hash literal braces ({ key: value } instead of {key: value})
  • Replaced conditional assignment pattern from unless modifier to ||= operator
  • Updated .rubocop.yml to disable Lint/RedundantCopDisableDirective while 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.

Copy link
Member

@fletchto99 fletchto99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ lint changes look good!

@rei-moo rei-moo mentioned this pull request Dec 12, 2025
2 tasks
@rei-moo rei-moo merged commit 33d6461 into main Dec 12, 2025
21 checks passed
@rei-moo rei-moo deleted the rei-moo/lint branch December 12, 2025 18:49
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants