Skip to content

Fetch hyperformula-tests before running linter - #1672

Merged
sequba merged 1 commit into
developfrom
fix-lint-action-on-gh
May 11, 2026
Merged

sequba merged 1 commit into
developfrom
fix-lint-action-on-gh

Conversation

@sequba

@sequba sequba commented May 11, 2026

Copy link
Copy Markdown
Contributor

Summary

The lint GitHub Action did not check out the hyperformula-tests repository before running ESLint. As a result, lint errors inside files under test/hyperformula-tests/ were silently skipped in CI and only surfaced when running npm run lint locally.

This PR aligns .github/workflows/lint.yml with .github/workflows/test.yml so the linter sees the same source tree as the test jobs.

Changes

  • .github/workflows/lint.yml
    • Add a Checkout hyperformula-tests repository step (using DEPLOY_TOKEN, target path test/hyperformula-tests).
    • Add a Fetch hyperformula-tests and sync branches step running test/fetch-tests.sh.
    • Name the existing main-repo checkout step for consistency with test.yml.

@sequba sequba self-assigned this May 11, 2026
@sequba
sequba requested a review from marcin-kordas-hoc May 11, 2026 14:08
@netlify

netlify Bot commented May 11, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for hyperformula-docs ready!

Name Link
🔨 Latest commit c5dc295
🔍 Latest deploy log https://app.netlify.com/projects/hyperformula-docs/deploys/6a01e2f377f9410008bbfb2c
😎 Deploy Preview https://deploy-preview-1672--hyperformula-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented May 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.16%. Comparing base (1b6767f) to head (c5dc295).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1672   +/-   ##
========================================
  Coverage    97.16%   97.16%           
========================================
  Files          175      175           
  Lines        15319    15319           
  Branches      3287     3287           
========================================
  Hits         14884    14884           
  Misses         435      435           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented May 11, 2026 •

Copy link
Copy Markdown

Performance comparison of head (c5dc295) vs base (1b6767f)

                                     testName |   base |   head | change
------------------------------------------------------------------------
                                      Sheet A | 516.87 | 490.36 | -5.13%
                                      Sheet B | 171.03 | 156.34 | -8.59%
                                      Sheet T | 143.49 | 137.03 | -4.50%
                                Column ranges | 533.53 | 522.16 | -2.13%
Sheet A:  change value, add/remove row/column |  16.57 |  16.36 | -1.27%
 Sheet B: change value, add/remove row/column | 143.64 | 141.83 | -1.26%
                   Column ranges - add column | 158.01 | 159.54 | +0.97%
                Column ranges - without batch | 483.51 | 493.34 | +2.03%
                        Column ranges - batch | 121.46 | 129.57 | +6.68%

@sequba
sequba merged commit d213a57 into develop May 11, 2026
33 of 35 checks passed
@sequba
sequba deleted the fix-lint-action-on-gh branch May 11, 2026 14:31
sequba added a commit that referenced this pull request May 19, 2026
## Summary

Adds a single canonical `### OFFSET function` sub-section under `##
Nuances of the implemented functions` in
`docs/guide/known-limitations.md`. Documents all six behavioral limits
of the OFFSET function in HyperFormula, each backed either by an
existing test in `unit/parser/offset-translation.spec.ts` or by a
runtime check captured before this PR was opened.

Removes the now-superseded one-row OFFSET entry from
`docs/guide/list-of-differences.md` (per Kuba's decision in the
2026-04-21 meeting: *"można wtedy to stąd też usunąć. Żeby wszystko było
tam jednak"*). The HF-vs-Excel/Sheets behavioral differences for OFFSET
are not lost — they remain documented in full in `known-limitations.md`
under the new sub-section, which is the canonical place for parse-time
restrictions per the 04-21 decision to consolidate.

> **Note on PR routing**: this PR replaces #1662 which was opened from a
fork branch. Same content, now from upstream branch — CI will have full
access (no fork-PR DEPLOY_TOKEN issue). Closing #1662 in favor of this
one.

## Linked

- Closes
[#1572](#1572) —
*Docs: describe limitations of the OFFSET function*
- Tracks the dynamic-args follow-up:
[#910](#910)
- Out of scope (separate task):
[#943](#943) —
restructuring `known-limitations` / `list-of-differences` /
`specifications-and-limits` pages
- Unblocked by:
[handsontable/hyperformula-tests#12](handsontable/hyperformula-tests#12)
(merged 2026-05-14, cleared lint regression introduced by #1672)
- Internal spec / tech rationale / implementation plan: tracked in the
team workspace (not committed); summary in this PR description
- Supersedes: #1662

## Limits documented

1. First argument must be a single-cell reference (passing a range =
parser error stored as cell value)
2. Row/column/height/width arguments must be static integer literals
(parser error otherwise)
3. Height and width must be **bare** positive integer literals —
`NUMBER` AST nodes only (unary `+`, parens, non-integers, values <1 all
rejected at parse time)
4. Out-of-sheet target → `#REF!` error stored at parse time (not
evaluation time), with the message *Resulting reference is out of the
sheet*
5. `getCellFormula` returns the resolved reference, not the original
`=OFFSET(...)`
6. Architectural rationale: OFFSET is rewritten at parse time into a
plain cell reference, so introspection via `getCellFormula` shows the
resolved reference rather than the call

## Runtime verification

All six limits were verified against this branch's HEAD before
publishing:

```
A. OFFSET in registered names: false  (correct — OFFSET is parse-time, not registered)
B. getCellFormula recovers: "=B1"     (rewritten reference, NOT "=OFFSET(A1, 0, 1)")
C. Out-of-sheet value: { value: "#REF!", message: "Resulting reference is out of the sheet." }
```

Tests covering all six limits live in
`test/hyperformula-tests/unit/parser/offset-translation.spec.ts` (24
tests, lines 13–206 in the private repo). Run via `npm run test:jest --
--testPathPattern="offset-translation"`.

## Test plan

- [ ] CI green on `handsontable/hyperformula`
- [ ] Netlify deploy preview:
[`/guide/known-limitations`](https://deploy-preview-1666--hyperformula-dev-docs.netlify.app/docs/guide/known-limitations.html)
— verify the new `### OFFSET function` sub-section renders, including
the four embedded `js` code blocks
- [ ] Netlify deploy preview:
[`/guide/list-of-differences`](https://deploy-preview-1666--hyperformula-dev-docs.netlify.app/docs/guide/list-of-differences.html)
— verify the table is intact and the OFFSET row is gone

## Notes

- This is docs-only — no CHANGELOG entry per project convention.
- The internal `ErrorMessage.OutOfSheet` string is intentionally NOT
quoted verbatim in the docs; the bullet describes the behavior instead,
so future internal-string refactors don't break the docs.
- Post-Codex review (2026-05-14): wording clarified to distinguish
parser-error-as-cell-value vs API exception, and to specify that
height/width accept only bare `NUMBER` literals (unary `+` etc.
rejected).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk docs-only change; the main risk is confusing users if the
newly documented OFFSET constraints are inaccurate or drift from
implementation.
> 
> **Overview**
> Adds a canonical **`### OFFSET function`** section to
`docs/guide/known-limitations.md` describing HyperFormula’s parse-time
rewriting behavior and the resulting constraints (single-cell first arg,
static integer shifts/sizes, strict positive literal height/width,
out-of-sheet `#REF!` at parse time, and `getCellFormula` returning the
resolved reference), with small JS snippets.
> 
> Removes the now-redundant `OFFSET` row from
`docs/guide/list-of-differences.md` to consolidate documentation in one
place.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
67ad2cd. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Kuba Sekowski <jakub.sekowski@handsontable.com>
marcin-kordas-hoc added a commit that referenced this pull request May 25, 2026
Three concerns surfaced by `prep ultra` (Opus fresh-eyes review) and the
A+C parallel review on HEAD `c3b65382a`. Addressing all three before
flip-to-review.

**L1 — Docs adapter regex divergence from core guard** (Ultra Low):
The first `CURRENCY_RULES` pattern in `docs/guide/currency-handling.md`
used `[^\-\]]*` (zero-or-more) for the SYMBOL portion, where the
production `LCID_CURRENCY_TAG` in `src/format/format.ts:26` uses
`[^\-\]]+` (one-or-more). The looser docs regex would cause copy-paste
users to mis-classify Excel's locale-only modifier `[$-409]` (used on
date/time formats) as a currency format and route it through the LCID
table, producing silent en-US currency formatting on what is meant to be
a Polish/English date format. Tightened to `+` and added an explanatory
comment so future readers know why the constraint is one-or-more.
Regenerated `test-utils/snippets/currency-adapter.generated.ts` via
`npm run snippets:extract` so the codegen artifact picks up the fix.

**M1 — CHANGELOG framing** (Ultra Medium):
The existing `Added a stringifyCurrency config option` line is purely
additive framing. But the LCID guards in `defaultStringifyDateTime` and
`defaultStringifyDuration` change observable `TEXT` output for **every**
LCID-tagged currency format (`[$USD-409] #,##0.00`, `[$€-2] #,##0.00`,
etc.) regardless of whether a `stringifyCurrency` callback is configured.
Pre-fix: mangled by the date parser (`[$US9-409]`). Post-fix: falls
through to `numberFormat`. Strictly an improvement, but upgraders who
snapshot-test `TEXT()` output should know to expect it. Added a `Fixed`
entry describing the behavioural correction with concrete before/after.

**Lint blocker** (A+C parallel review):
Added `test-utils/snippets/` to `.eslintignore`. Generated adapter
content carries `@ts-nocheck` (necessary — JS body without TypeScript
annotations) and has implicit-`any` operands (`'-' + match[2]`) that
ESLint's `@typescript-eslint/ban-ts-comment` + `no-unsafe-*` rules
flagged as errors on HEAD `c3b65382a` lint(22). Auto-generated content
shouldn't be linted; `script/`, `commonjs/`, `dist/`, etc. were already
ignored — extending the same policy to `test-utils/snippets/` is
consistent.

Companion fix on hyperformula-tests `feature/hf-24-stringify-currency`
commit `7663f5c` cleans up pre-existing lint errors that became visible
after PR #1672 extended lint scope to tests-repo
(`Array<T>` → `T[]`, `opt_out` → `optOut`, `as unknown as string` →
`as string`).

Local verification (2026-05-25):
- `npm run compile` clean
- `npx tsc -p tsconfig.test.json --noEmit` clean
- `npm run snippets:check` exit 0 (generated byte-identical post-regen)
- `eslint` on modified files: 0 errors
- `npm run test:jest -- --testPathPattern function-text` reports 53/53 pass
marcin-kordas-hoc added a commit that referenced this pull request May 28, 2026
Three concerns surfaced by `prep ultra` (Opus fresh-eyes review) and the
A+C parallel review on HEAD `c3b65382a`. Addressing all three before
flip-to-review.

**L1 — Docs adapter regex divergence from core guard** (Ultra Low):
The first `CURRENCY_RULES` pattern in `docs/guide/currency-handling.md`
used `[^\-\]]*` (zero-or-more) for the SYMBOL portion, where the
production `LCID_CURRENCY_TAG` in `src/format/format.ts:26` uses
`[^\-\]]+` (one-or-more). The looser docs regex would cause copy-paste
users to mis-classify Excel's locale-only modifier `[$-409]` (used on
date/time formats) as a currency format and route it through the LCID
table, producing silent en-US currency formatting on what is meant to be
a Polish/English date format. Tightened to `+` and added an explanatory
comment so future readers know why the constraint is one-or-more.
Regenerated `test-utils/snippets/currency-adapter.generated.ts` via
`npm run snippets:extract` so the codegen artifact picks up the fix.

**M1 — CHANGELOG framing** (Ultra Medium):
The existing `Added a stringifyCurrency config option` line is purely
additive framing. But the LCID guards in `defaultStringifyDateTime` and
`defaultStringifyDuration` change observable `TEXT` output for **every**
LCID-tagged currency format (`[$USD-409] #,##0.00`, `[$€-2] #,##0.00`,
etc.) regardless of whether a `stringifyCurrency` callback is configured.
Pre-fix: mangled by the date parser (`[$US9-409]`). Post-fix: falls
through to `numberFormat`. Strictly an improvement, but upgraders who
snapshot-test `TEXT()` output should know to expect it. Added a `Fixed`
entry describing the behavioural correction with concrete before/after.

**Lint blocker** (A+C parallel review):
Added `test-utils/snippets/` to `.eslintignore`. Generated adapter
content carries `@ts-nocheck` (necessary — JS body without TypeScript
annotations) and has implicit-`any` operands (`'-' + match[2]`) that
ESLint's `@typescript-eslint/ban-ts-comment` + `no-unsafe-*` rules
flagged as errors on HEAD `c3b65382a` lint(22). Auto-generated content
shouldn't be linted; `script/`, `commonjs/`, `dist/`, etc. were already
ignored — extending the same policy to `test-utils/snippets/` is
consistent.

Companion fix on hyperformula-tests `feature/hf-24-stringify-currency`
commit `7663f5c` cleans up pre-existing lint errors that became visible
after PR #1672 extended lint scope to tests-repo
(`Array<T>` → `T[]`, `opt_out` → `optOut`, `as unknown as string` →
`as string`).

Local verification (2026-05-25):
- `npm run compile` clean
- `npx tsc -p tsconfig.test.json --noEmit` clean
- `npm run snippets:check` exit 0 (generated byte-identical post-regen)
- `eslint` on modified files: 0 errors
- `npm run test:jest -- --testPathPattern function-text` reports 53/53 pass
marcin-kordas-hoc added a commit that referenced this pull request Aug 31, 2026
Both predate this branch's rename commit -- they came in via the earlier
merge of origin/develop, from #1703 (DEV_DOCS.md) and #1616/#1672
(the hyperformula-tests checkout in lint.yml). Flagged by Cursor Bugbot on
this PR because this is the first real review this branch has ever had.

1. DEV_DOCS.md pointed contributors at `test/unit/interpreter/` for new
   interpreter specs. That path doesn't exist in this repo -- interpreter
   and function specs live in the private `hyperformula-tests` repo, checked
   out under `test/hyperformula-tests/`. Fixed the instruction.

2. `.github/workflows/lint.yml` checks out `hyperformula-tests` into
   `test/hyperformula-tests` before `npm run lint` (added in #1616/#1672),
   but `.eslintrc.js`'s `parserOptions.project` only covers `tsconfig.json`,
   whose `include` is `["src"]`. `npm run lint` is `eslint . --ext .js,.ts`,
   so every private-repo file gets swept in with no TS project backing it.

   Verified locally: `npx eslint . --ext .js,.ts` against the full tree
   (with hyperformula-tests checked out, as CI does) never finished in 90s
   before this fix. Added `test/hyperformula-tests` to `.eslintignore`
   (same pattern as the other checked-out/generated directories already
   listed there) -- reran, 16s, 0 files under hyperformula-tests touched,
   same 0-errors/2234-warnings result as before on the files that matter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant