fix(hypatia): scoped exemption for the unsatisfiable unsafe_block rule - #147
Merged
Merged
Conversation
The rule is a bare `unsafe\s*\{` regex — it flags every unsafe block
unconditionally; the 'requires SAFETY comment' in its description is not
checked. my-llvm's single unsafe block is mandated by inkwell's unsafe
build_gep and carries a full SAFETY invariant argument. Same mechanism
as the existing coq_axiom / transmute keyword-match exemptions.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Follow-up to #146 — the one finding that survived. hypatia's
unsafe_blockrule is a bareunsafe\s*\{regex (lib/rules/code_safety.ex): it flags every unsafe block regardless of documentation, so no SAFETY comment can ever satisfy it (the adjacency fix in #146 was a no-op against a rule that never looks). The single unsafe block in my-llvm is mandatory (inkwell declaresbuild_gepunsafe) and fully documented, so this uses the same scoped.hypatia-ignoremechanism as the existingcoq_axiom/transmutekeyword-match exemptions — a permanent fact should not be expiring baseline debt. Upstream rule fix is a candidate for hypatia itself.🤖 Generated with Claude Code