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.
🔧 Fix Rubocop violations and modernize configuration
📋 Summary
This PR resolves 48+ Rubocop style violations across the codebase and modernizes the Rubocop configuration files for compatibility with newer versions.
🚨 Problem Identified
When attempting to run Rubocop on the current codebase, the following compatibility error occurs:
This error prevents contributors using newer Rubocop versions from running style checks or auto-corrections, creating a barrier to contribution.
🎯 What's Changed
✅ Compatibility Fixes
.rubocop_todo.ymland.rubocop.yml✅ Code Quality Improvements
📁 Files Modified
Core Files
lib/httplog/http_log.rb- 44+ violations fixedlib/httplog/configuration.rb- Layout and alias improvementslib/httplog/version.rb- Removed unnecessary.freezeAdapters
lib/httplog/adapters/ethon.rb- Lambda literal spacinglib/httplog/adapters/httpclient.rb- Redundant begin blocks, conditional formattingConfiguration Files
.rubocop.yml- Updated deprecated cop names for newer Rubocop versionsLayout/IndentArray→Layout/FirstArrayElementIndentationTargetRubyVersionto match gemspec (>= 2.6).rubocop_todo.yml- Fixed obsolete configuration referencesMetrics/LineLength→Layout/LineLength🔍 Types of Violations Fixed
Layout & Formatting
Style Improvements
-> (*)→->(*)ifusage for single-line statementsbeginblock removalCompatibility Updates
Metrics/LineLength→Layout/LineLengthLayout/IndentArray→Layout/FirstArrayElementIndentationTargetRubyVersionto match gemspec requirement (>= 2.6)🧪 Testing
📊 Before & After
Before
After
rubocop lib/ # ✅ 10 files inspected, no offenses detected🎉 Benefits
🔗 Related Issues
This PR addresses a compatibility issue that was preventing contributors from using modern development tools, while simultaneously improving overall code quality.
🚨 Breaking Changes
None - This PR contains only style improvements and configuration updates with zero functional changes.
📝 Checklist
💬 Notes for Reviewers
This PR addresses both a practical compatibility issue and code quality improvements. The main driver was the obsolete Rubocop configuration that was blocking contributors using newer versions. While fixing that, I took the opportunity to resolve the existing style violations.
All changes are either:
Feel free to run the tests to confirm no functional changes were introduced! 🚀
Type:
refactor| Priority:medium| Size:medium