Skip to content
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

cask/utils: Make more noise when encountering undefined methods #15149

Merged
merged 1 commit into from Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Library/Homebrew/cask/utils.rb
Expand Up @@ -104,7 +104,7 @@ def self.method_missing_message(method, token, section = nil)
message << "during #{section} " if section
message << "on Cask #{token}."

opoo "#{message}\n#{error_message_with_suggestions}"
ofail "#{message}\n#{error_message_with_suggestions}"
Copy link
Member

Choose a reason for hiding this comment

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

Makes sense to me but @Homebrew/cask folks may have an opinion about whether we want to keep opoo/a warning for users rather than maintainers here?

Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer we throw an error for everyone. No busted syntax allowed ❌

end
end
end
4 changes: 2 additions & 2 deletions Library/Homebrew/test/cask/dsl_spec.rb
Expand Up @@ -20,10 +20,10 @@
end
end

it "prints a warning that it has encountered an unexpected method" do
it "prints an error that it has encountered an unexpected method" do
expected = Regexp.compile(<<~EOS.lines.map(&:chomp).join)
(?m)
Warning:
Error:
.*
Unexpected method 'future_feature' called on Cask unexpected-method-cask\\.
.*
Expand Down