Repository navigation
Make HAS_ALLOW_UNSAFE case insensitive (closes #35) - #99
Merged
Merged
Conversation
Accept Y/yes/Yes/YES in addition to y so the toggle is not silently ignored for common truthy spellings. Closes kdabir#35
kdabir
approved these changes
Sep 5, 2026
Owner
|
Thanks for the contribution |
social4hyq
pushed a commit
to social4hyq/homebrew-core
that referenced
this pull request
Sep 20, 2026
has 1.6.0 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre>## What's Changed * update link by @oooooooo in kdabir/has#90 * docs(README): add mise alternate installation documentation by @jylenhof in kdabir/has#92 * feat: added "just" as supported program by @goto-dev-null in kdabir/has#96 * fix: failing unit test assumes dev has `bc` installed by @goto-dev-null in kdabir/has#98 * feat: add shell completions for bash and zsh by @njg7194 in kdabir/has#93 * fix: color flags not working by @goto-dev-null in kdabir/has#97 * Make HAS_ALLOW_UNSAFE case insensitive (closes #35) by @chiliec in kdabir/has#99 * fix: stopped bzip2 from hanging by @goto-dev-null in kdabir/has#94 ## New Contributors * @oooooooo made their first contribution in kdabir/has#90 * @jylenhof made their first contribution in kdabir/has#92 * @goto-dev-null made their first contribution in kdabir/has#96 * @njg7194 made their first contribution in kdabir/has#93 * @chiliec made their first contribution in kdabir/has#99 **Full Changelog**: https://github.com/kdabir/has/compare/v1.5.2...v1.6.0</pre> <p>View the full release notes at <a href="https://github.com/kdabir/has/releases/tag/v1.6.0">https://github.com/kdabir/has/releases/tag/v1.6.0</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!19964
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Closes #35.
HAS_ALLOW_UNSAFEwas only honored when set to the exact lowercasey, so common truthy spellings (Y,yes,YES) were silently ignored and the dynamic/unsafe check never ran. This matches the maintainer's +1 for case-insensitivity in the issue thread.Fix
The guard now accepts
y/Yandyes(any case) via glob patterns in[[ ]]:Glob patterns keep this bash 3.2-safe (macOS) — no
${var,,}. No breaking change:HAS_ALLOW_UNSAFE=N/empty/anything else still disables the unsafe path exactly as before.Tests
Added a unit test asserting
Y,yes,Yes,YESall enable the unsafe path (output no longer containsfoobar not understood).Validation
Verified genuine RED→GREEN: reverting only the source guard back to
== "y"turns the new test red (foobar not understoodreappears forY/yes/…); restoring the fix makes it green.Note: two tests (
testing coreutils commands,status code in quiet mode still equal to number of failed commands) fail on a cleanmastercheckout on my machine too — they are pre-existing and outside this diff (which touches only theHAS_ALLOW_UNSAFEguard + one new test).Happy to adjust (e.g. narrow to just
[Yy]if you'd rather not acceptyes).