Skip to content

Fix rubocop CI failures across cache, driver_metadata, percy, and spec files#27

Draft
Copilot wants to merge 2 commits intoPPLT-5036from
copilot/sub-pr-26
Draft

Fix rubocop CI failures across cache, driver_metadata, percy, and spec files#27
Copilot wants to merge 2 commits intoPPLT-5036from
copilot/sub-pr-26

Conversation

Copy link

Copilot AI commented Mar 20, 2026

The lint CI was failing with 87 rubocop offenses across 7 files introduced by the responsive capture and cross-iframe feature additions.

Changes

lib/cache.rb

  • Fixed 4→2 space indentation throughout class body
  • Added .freeze to string constants; suppressed Style/MutableConstant inline for the intentionally mutable CACHE = {} hash

lib/driver_metadata.rb

  • Fixed 4→2 space indentation
  • Split long log line (116 chars) across two lines
  • Restructured caps = begin ... rescue to standalone begin/rescue block to fix Layout/RescueEnsureAlignment
  • Removed trailing blank line

lib/percy.rb

  • Split long constant assignments (PERCY_RESPONSIVE_CAPTURE_*) across lines
  • Removed trailing whitespace on blank lines
  • Fixed SpaceInsideHashLiteralBraces in get_origin and process_frame
  • Added trailing comma to multiline hash in process_frame and multiline method call in percy_screenshot
  • Fixed Style/TrailingCommaInArguments on execute_cdp call
  • Changed double-quoted JS strings with no interpolation to single-quoted
  • Added empty line after guard clause in get_responsive_widths
  • Fixed missing space around ternary : operator

spec/lib/percy/cache_spec.rb

  • Fixed SpaceInsideHashLiteralBraces in let(:caps)
  • not_toto_not (×3)
  • before dobefore(:each) do

spec/lib/percy/driver_metadata_spec.rbdriver_meta_data_spec.rb

  • Renamed file to satisfy RSpec/FilePath (class DriverMetaData maps to driver_meta_data)
  • Converted let(:caps_hash) and stub_request to multi-line to fix line length
  • before dobefore(:each) do (×5)
  • Converted have_received spy assertions to receive message expectations (×2), moving them before the action
  • Split long allow(...instance_variable_get...) lines

spec/lib/percy/percy_spec.rb

  • Split long raise_error matcher lines (×3)
  • Split long expect(...get_origin...) lines + not_toto_not
  • before dobefore(:each) do (×2)
  • Split long allow(...data-percy-element-id...) lines (×3)
  • Converted have_received(:parent_frame) to receive expectation before action
  • not_toto_not (×4)
  • Replaced nested ternary operators with if/elsif/else (×3):
# before
call_count == 1 ? {'html' => '<html/>'} : call_count == 2 ? nil : {'html' => '<frame/>'}

# after
if call_count == 1
  {'html' => '<html/>'}
elsif call_count == 2
  nil
else
  {'html' => '<frame/>'}
end

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…he, driver_metadata, percy and spec files

Co-authored-by: yashmahamulkar-bs <253657699+yashmahamulkar-bs@users.noreply.github.com>
Copilot AI changed the title [WIP] Add responsive capture and cross iframe features Fix rubocop CI failures across cache, driver_metadata, percy, and spec files Mar 20, 2026
Copilot AI requested a review from yashmahamulkar-bs March 20, 2026 16:47
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.

2 participants