Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Library/Homebrew/cask/cask.rb
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ def to_h
"version" => version,
"autobump" => autobump?,
"no_autobump_message" => no_autobump_message,
"livecheck_defined" => livecheck_defined?,
"skip_livecheck" => livecheck.skip?,
Comment on lines 426 to 429
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

Adding "livecheck_defined" => livecheck_defined? to Cask#to_h won’t make this value available via the JSON API: Homebrew::API::Cask::CaskStructGenerator ends by calling CaskStruct.from_hash, which slices to CaskStruct props and will drop the new key unless Homebrew::API::CaskStruct is updated. If the goal is to have this in API JSON for Tap.autobump, add a livecheck_defined prop to CaskStruct and plumb it through struct generation/serialization (and then set it on the API-loaded cask’s DSL so cask.livecheck_defined? matches API data).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm not sure that's correct. With this branch checked out, I ran brew generate-formula-api and brew generate-cask-api in the formulae.brew.sh repository and confirmed that the generated JSON contained the expected "livecheck_defined" value.

"installed" => installed_version,
"installed_time" => install_time&.to_i,
Expand Down
1 change: 1 addition & 0 deletions Library/Homebrew/formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2864,6 +2864,7 @@ def to_hash
"compatibility_version" => compatibility_version,
"autobump" => autobump?,
"no_autobump_message" => no_autobump_message,
"livecheck_defined" => livecheck_defined?,
"skip_livecheck" => livecheck.skip?,
Comment on lines +2867 to 2868
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

Adding "livecheck_defined" => livecheck_defined? here won’t actually make the field appear in the generated JSON API data: API generation runs FormulaStructGenerator.generate_formula_struct_hash and then FormulaStruct.from_hash, which slices to FormulaStruct props (dropping unknown keys). To expose this in the API output, you’ll need to add a corresponding prop to Homebrew::API::FormulaStruct and plumb it through generate_formula_struct_hash/serialization.

Suggested change
"livecheck_defined" => livecheck_defined?,
"skip_livecheck" => livecheck.skip?,

Copilot uses AI. Check for mistakes.
"bottle" => {},
"pour_bottle_only_if" => self.class.pour_bottle_only_if&.to_s,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"version": "1.2.3",
"autobump": true,
"no_autobump_message": null,
"livecheck_defined": false,
"skip_livecheck": false,
"installed": null,
"installed_time": null,
Expand Down
Loading