feat(rules): add Dhall review rules - #963
Open
chethanuk wants to merge 1 commit into
Open
Conversation
Contributor
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 2 selected item(s). |
chethanuk
force-pushed
the
wf/dhall-language-support
branch
from
August 17, 2026 06:19
4bead34 to
e685498
Compare
Contributor
Author
|
@lizhengfeng101 Please review and merge this. Future main updates might cause more conflicts. Thanks :) |
chethanuk
force-pushed
the
wf/dhall-language-support
branch
from
August 17, 2026 07:35
e685498 to
611b2cd
Compare
wu21-web
approved these changes
Aug 17, 2026
chethanuk
force-pushed
the
wf/dhall-language-support
branch
from
August 17, 2026 12:28
611b2cd to
848246c
Compare
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.
Description
.dhallfiles were never reviewed. The extension is missing fromsupported_file_types.json, soIsAllowedExtdrops them at the filter gate before any rule can run, which is why a rule doc on its own would never have been reachable.This adds
.dhallto the allowlist and registers one rule doc inpath_rule_map:**/*.dhall→dhall.md. Data only, no Go source changes.The headline check is a remote import by URL with no trailing
sha256:<hex>integrity hash. Dhall resolves those over the network when the file is evaluated, so an unpinned import hands whoever controls that URL control of the configuration, and the content it returns can change between two evaluations of the same file.dhall freezewrites the hash.Two carve-outs keep that check usable. The Prelude's
missing sha256:<hex> ? ./local.dhallidiom is a content-addressed cache lookup with a working local fallback rather than an unpinned import, and it sits at the top of nearly every file that imports the Prelude. Bare relative imports (./types.dhall) are the overwhelming majority of imports in a project and pinning them is not the convention. The totality section carves outNatural/foldandList/foldfor the same reason: folds are how iteration is written in a language with no recursion, so flagging them would fire on almost every file.No exclude patterns are added.
IsExcludedPathapplies every pattern to every path with no language dispatch, so a pattern is only worth its repo-wide reach when it matches paths that are reliably test-only or generated. Dhall has neither in tree. Its import cache lives under$XDG_CACHE_HOME/dhall, outside the repository, so it never appears in a diff, and there is no vendored dependency directory or build output to skip.Limitation
.dhalldiffs that used to be skipped are now reviewed. Anyone who does not want that opts out with user exclude globs, which are checked before the allowlist.Type of Change
How Has This Been Tested?
make testpasses locallyRows appended to the existing table tests:
TestIsAllowedExt—.dhalland.DHALL.TestResolve_DefaultRules—config/prod.dhallandschemas/package.dhallresolve by a heading anchor unique todhall.md.Checklist
go fmt,go vet)The rule table in
pages/src/content/docs/{en,ja,ru,zh}/review-rules.mdlists the new pattern.Related Issues
Part of #470.