Skip to content

fix(brew): improve if hardware structures #5741

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

Merged
merged 4 commits into from
Apr 28, 2025
Merged

fix(brew): improve if hardware structures #5741

merged 4 commits into from
Apr 28, 2025

Conversation

caarlos0
Copy link
Member

@caarlos0 caarlos0 added the bug Something isn't working label Apr 25, 2025
@caarlos0 caarlos0 requested a review from Copilot April 25, 2025 23:53
@caarlos0 caarlos0 self-assigned this Apr 25, 2025
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 25, 2025
Copy link

cloudflare-workers-and-pages bot commented Apr 25, 2025

Deploying goreleaser with  Cloudflare Pages  Cloudflare Pages

Latest commit: ea9ae43
Status: ✅  Deploy successful!
Preview URL: https://ba11f02e.goreleaser.pages.dev
Branch Preview URL: https://rb.goreleaser.pages.dev

View logs

Copy link
Contributor

@Copilot 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 pull request refactors the hardware conditional logic in the brew template for Linux packages to simplify the structure and improve clarity.

  • Consolidates nested hardware checks into combined one-line conditions
  • Adjusts header indentation in the template for a more concise format
Files not reviewed (19)
  • internal/pipe/brew/testdata/TestFullFormulae.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestFullFormulaeLinuxOnly.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestFullPipe/custom_block.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestFullPipe/custom_download_strategy.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestFullPipe/custom_require.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestFullPipe/default.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestFullPipe/default_gitlab.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestFullPipe/git_remote.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestFullPipe/open_pr.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestFullPipe/valid_repository_templates.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestFullPipe/with_header.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestFullPipe/with_many_headers.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v1.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v2.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v3.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v4.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv5.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv6.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv7.rb.golden: Language not supported
Comments suppressed due to low confidence (2)

internal/pipe/brew/templates/linux_packages.rb:4

  • Verify that combining the nested 'if' statements into this single line preserves the intended short-circuit behavior and does not introduce unintended side effects.
if Hardware::CPU.intel? and Hardware::CPU.is_64_bit?

internal/pipe/brew/templates/linux_packages.rb:14

  • Confirm that reducing the indentation from 10 to 8 spaces aligns with the desired formatting of the output, as a change might affect the rendered header layout.
{{- join .Headers | indent 8 }}

@caarlos0 caarlos0 requested a review from Copilot April 25, 2025 23:53
Copy link
Contributor

@Copilot 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 refactors the hardware architecture conditional checks in the Linux packages template to simplify the logic and improve clarity. Key changes include:

  • Combining nested Intel CPU checks into a single condition.
  • Separating ARM64 and ARM CPU checks using combined logical expressions.
  • Adjusting header indentation formatting.
Files not reviewed (19)
  • internal/pipe/brew/testdata/TestFullFormulae.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestFullFormulaeLinuxOnly.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestFullPipe/custom_block.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestFullPipe/custom_download_strategy.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestFullPipe/custom_require.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestFullPipe/default.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestFullPipe/default_gitlab.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestFullPipe/git_remote.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestFullPipe/open_pr.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestFullPipe/valid_repository_templates.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestFullPipe/with_header.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestFullPipe/with_many_headers.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v1.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v2.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v3.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v4.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv5.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv6.rb.golden: Language not supported
  • internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv7.rb.golden: Language not supported
Comments suppressed due to low confidence (1)

internal/pipe/brew/templates/linux_packages.rb:14

  • The header indentation was modified from 10 to 8 spaces. Please verify that this change produces the intended alignment in the final output.
{{- join .Headers | indent 8 }}

Copy link

codecov bot commented Apr 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.92%. Comparing base (c0b5a1c) to head (ea9ae43).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5741   +/-   ##
=======================================
  Coverage   82.92%   82.92%           
=======================================
  Files         161      161           
  Lines       15916    15916           
=======================================
  Hits        13198    13198           
  Misses       2144     2144           
  Partials      574      574           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@caarlos0 caarlos0 merged commit 051b505 into main Apr 28, 2025
18 checks passed
@caarlos0 caarlos0 deleted the rb branch April 28, 2025 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant