Repository navigation
Conversation
Contributor
|
OpenCodeReview · Complete review: 2 of 2 selected files covered 0 findings. Review infoReviewed commits:
|
This branch has not been deployed
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
Adds review support for Tera (
.tera) templates, the Tera item of the Template Engines group in #470..terafiles are currently skipped asunsupported_ext, andocr rules checkfalls back to the genericdefault.md. This affects Rust web apps built with Rocket, which names Tera templates*.html.tera(see its official templating example).Changes:
supported_file_types.json: add.teradefault_exclude_patterns.json: unchanged. Tera has no test-file convention (same as Pug); generic fixture exclusions still applyrule_docs/tera.md, registered as**/*.tera→tera.mdinsystem_rules.jsonreview-rules.mdmapping table updated in all locales (en, ja, ko, ru, tr, zh)tera.mdcovers Tera-specific pitfalls rather than reusingjinja.md:.html,.htm,.xmlby default), sopage.html.terais not escaped unless the host strips.teraor configuresautoescape_ondefaultonly applies to undefined values{% set %}inside loops vs{% set_global %}self::Type of Change
How Has This Been Tested?
make testpasses locallyManual testing (describe below)
make checkpasses (license headers, English-only check, gofmt, go vet)make coveragepasses (91.3%, threshold 90%)Full
go test ./...passes.make testcould not run locally because-racerequires cgo, which is not set up on my Windows machineNew tests:
.tera/.TERAinTestIsAllowedExt;IsExcludedPathcases (fixture excluded,templates/page.html.teraandtests/templates/page.terastill reviewed);TestResolve_DefaultRulescases forpage.html.tera,base.teraandpage.HTML.TERAManually checked with
ocr delegate previewonmain:templates/page.html.terawas excluded asunsupported_extbefore this changeChecklist
go fmt,go vet)AI disclosure: I used Claude Code (Claude Opus 5.5) to help with the implementation and the rule doc. I reviewed every line and checked the rule doc against the official Tera documentation.
Related Issues
Closes #2154
Part of #470