-
Notifications
You must be signed in to change notification settings - Fork 253
fix linting issues #563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix linting issues #563
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.
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 << 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.
fletchto99
left a comment
There was a problem hiding this 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!
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>
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>
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.