feat(core): migrate ReScript to AffineScript with 66-test suite#25
Merged
Conversation
hyperpolymath
enabled auto-merge (rebase)
June 14, 2026 02:24
- Add tests/ covering ByteDetector (17), PathHandler (17), SafeWhitespace (13), TextTransform (19) — all 66 pass - Fix byte_to_hex to handle multi-byte codepoints (>0xFF) - Move normalize_line_endings to run after trim_lines_fn so JS .trim() cannot strip \r from CRLF-normalized lines - Add scripts/build-all.sh; deno.json build-all delegates to it (deno task shell does not support POSIX for-in loops) - Inject missing cross-module symbols into TextTransform.deno.js via post-compile Python patch (compiler issue #122 workaround): LF/CRLF/CR constants, is_invisible helper, concat alias Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… build-all.sh Tests (4 SonarCloud issues): - TextTransform_test.js: remove unused `assertNotEquals` import; replace `assertEquals(x.length > 0, true)` with `assert(x.length > 0)` for the three check_constraints tests (S1128 + boolean-literal smell) - ByteDetector_test.js: remove tautological `|| report.length > 0` clause from the generate_report assertion (always true for non-empty output) Build script: - Replace `python3 - << PYEOF` heredoc with awk + POSIX shell; python3 is banned in this repo (CLAUDE.md) and unavailable in the Deno deploy env Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
hyperpolymath
force-pushed
the
claude/gallant-shannon-82193p
branch
from
June 14, 2026 02:27
7b33a65 to
d80aa61
Compare
|
🔍 Hypatia Security ScanFindings: 42 issues detected
View findings[
{
"reason": "Belt.Array deprecated -- use Array (12 occurrences)",
"type": "deprecated_api",
"file": "/home/runner/work/empty-linter/empty-linter/src/core/TextTransform.res",
"action": "module_replace",
"rule_module": "migration_rules",
"severity": "high"
},
{
"reason": "Js.Array2 deprecated -- use Array (1 occurrences)",
"type": "deprecated_api",
"file": "/home/runner/work/empty-linter/empty-linter/src/core/TextTransform.res",
"action": "search_replace",
"rule_module": "migration_rules",
"severity": "high"
},
{
"reason": "Js.String2 deprecated -- use String (9 occurrences)",
"type": "deprecated_api",
"file": "/home/runner/work/empty-linter/empty-linter/src/core/TextTransform.res",
"action": "search_replace",
"rule_module": "migration_rules",
"severity": "high"
},
{
"reason": "Belt.Array deprecated -- use Array (11 occurrences)",
"type": "deprecated_api",
"file": "/home/runner/work/empty-linter/empty-linter/src/core/ByteDetector.res",
"action": "module_replace",
"rule_module": "migration_rules",
"severity": "high"
},
{
"reason": "Js.Array2 deprecated -- use Array (2 occurrences)",
"type": "deprecated_api",
"file": "/home/runner/work/empty-linter/empty-linter/src/core/ByteDetector.res",
"action": "search_replace",
"rule_module": "migration_rules",
"severity": "high"
},
{
"reason": "Js.String2 deprecated -- use String (25 occurrences)",
"type": "deprecated_api",
"file": "/home/runner/work/empty-linter/empty-linter/src/core/ByteDetector.res",
"action": "search_replace",
"rule_module": "migration_rules",
"severity": "high"
},
{
"reason": "Belt.Array deprecated -- use Array (2 occurrences)",
"type": "deprecated_api",
"file": "/home/runner/work/empty-linter/empty-linter/src/core/PathHandler.res",
"action": "module_replace",
"rule_module": "migration_rules",
"severity": "high"
},
{
"reason": "Js.String2 deprecated -- use String (13 occurrences)",
"type": "deprecated_api",
"file": "/home/runner/work/empty-linter/empty-linter/src/core/PathHandler.res",
"action": "search_replace",
"rule_module": "migration_rules",
"severity": "high"
},
{
"reason": "Belt.Array deprecated -- use Array (6 occurrences)",
"type": "deprecated_api",
"file": "/home/runner/work/empty-linter/empty-linter/src/bindings/Deno.res",
"action": "module_replace",
"rule_module": "migration_rules",
"severity": "high"
},
{
"reason": "Js.Array2 deprecated -- use Array (2 occurrences)",
"type": "deprecated_api",
"file": "/home/runner/work/empty-linter/empty-linter/src/bindings/Deno.res",
"action": "search_replace",
"rule_module": "migration_rules",
"severity": "high"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
hyperpolymath
disabled auto-merge
June 14, 2026 02:28
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.



Summary
.res) to AffineScript (.affine)tests/directory with 66 passing tests covering ByteDetector, PathHandler, SafeWhitespace, and TextTransformscripts/build-all.shfor reproducible builds (deno task shell lacks POSIX for-loop)Technical notes
Compiler workaround (issue #122): AffineScript alpha does not inline zero-arg enum variant constructors or non-imported transitive dependencies across module boundaries.
scripts/build-all.shpost-patchesTextTransform.deno.jsafter compilation to inject the three missing symbols (LF/CRLF/CR,is_invisible,concat). Tracked in upstream AffineScript issue #122.Transform ordering fix: moved
normalize_line_endingsto run aftertrim_lines_fn; the previous ordering caused JS.trim()to strip\rfrom CRLF line endings (splitting on\nleaves a trailing\rper line which.trim()removes, discarding the normalization result).Test plan
deno task build-allcompiles all.affine→.deno.jsand injects workarounddeno test --allow-read --allow-write tests/→ 66 passed, 0 faileddeno task build-all && deno task test— end-to-end pipeline clean🤖 Generated with Claude Code