refactor(metadata): use snake_case for all catalogue parameter names (HF-249)#1709
Merged
sequba merged 1 commit intoJul 14, 2026
Conversation
…(HF-249) Normalize every FunctionDoc parameter name to snake_case for a consistent function-picker UI, replacing the mixed Title-case/underscore styles (e.g. Sum_Range/Sumrange/Number1/Number_1). Sibling params now agree (SUMIF & SUMIFS both use sum_range; MATCH & VLOOKUP both search_criterion). The migration generator (scripts/hf249-migrate-function-docs.ts) now emits snake_case via a shared toSnakeCase helper (camel/acronym splitting, separator unification, digits kept attached) plus a small segmentation table for run-on tokens the docs left unsplit; its main() is guarded so the helper is importable without side effects. Descriptions, examples and documentationUrl are untouched; custom-function positional names (Arg1, Arg2) are unchanged. Co-authored-by: Kuba Sekowski <sequba@users.noreply.github.com>
Contributor
|
Task linked: HF-249 HF function documentation available via API |
Performance comparison of head (07161a0) vs base (18d4246) |
4612e75
into
feature/hf-249-function-metadata-api
28 checks passed
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feature/hf-249-function-metadata-api #1709 +/- ##
========================================================================
+ Coverage 96.42% 96.61% +0.19%
========================================================================
Files 192 192
Lines 15585 15585
Branches 3447 3447
========================================================================
+ Hits 15028 15058 +30
+ Misses 557 527 -30
🚀 New features to boost your workflow:
|
marcin-kordas-hoc
added a commit
that referenced
this pull request
Jul 14, 2026
…(HF-300) Post-merge with the updated base (snake_case params #1709 + new functions): - Author XIRR, VSTACK, HSTACK, and fill TBILLEQ/TBILLPRICE 'discount' (base-added). - Restore examples mis-attached during conflict resolution: SEQUENCE, XNPV, GCD. - Remove SUM's stale per-function documentationUrl re-introduced by the merge (the shared .html default supplies it; comment already said it's absent). Source: https://app.clickup.com/t/86caprtgj ADR: adr/2026-07-13-hf300-function-metadata-enrichment.md Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Context
Addresses a code-review finding on #1692: the function-metadata catalogue mixed several parameter-name conventions, which surface directly in a function-picker UI. Even closely-related functions disagreed —
SUMIFusedRange, Criteria, Sumrange,SUMIFSusedSum_Range, Criterion_range1, Criterion1,AVERAGEIFusedRange, Criterion, Average_Range— mixing Title-case,snake_Case, and run-on tokens.This normalizes every
FunctionDocparameter name tosnake_caseso the catalogue is internally consistent.What changed
categories/*.tsfiles are nowsnake_case(lowercase words joined by_, camelCase/acronym boundaries split, separators unified, trailing digits kept attached:Number1/Number_1→number1).Sumrange→sum_range(matchesSUMIFS),Searchcriterion→search_criterion(matchesVLOOKUP/HLOOKUP), pluslogical_value,date_string,time_string,start_date,minimum_length,lower_bound,upper_bound,number_x,number_y.scripts/hf249-migrate-function-docs.ts) now emitssnake_casevia a shared, exportedtoSnakeCasehelper (+ a small segmentation table), so a future regeneration stays consistent. Itsmain()is guarded withrequire.main === moduleso the helper can be imported without side effects.descriptions,examples,documentationUrl, categories, short descriptions, ordering. Custom-function positional names (Arg1,Arg2, …) are unchanged — they are a documented, self-consistent placeholder for user functions that ship no metadata (see open question below).How did you test your changes?
tsc --noEmit— clean.eslinton the changed files — 0 errors.test/smoke.spec.ts— 4/4 pass.getFunctionDetailsparameter name matches^[a-z][a-z0-9]*(_[a-z0-9]+)*$;getAvailableFunctions/getFunctionDetailslist↔details parity still holds;SUMIF&SUMIFSboth exposesum_range;MATCH&VLOOKUPboth exposesearch_criterion;Arg1,Arg2.HSTACK/XIRR, the hand-authoredSUM/SUMIFfields, and a staleTEXTdescription — so the regen output was discarded).Types of changes
Related issues:
Notes for reviewers
hyperformula-tests#14) asserts specific parameter names (e.g.SUMIFparams); those expectations need updating to the newsnake_casenames.Arg1/Arg2. If you'd also like those lowercased (arg1/arg2), it's a 1-line change inbuildCustomFunctionDetailsplus acustom-functions.mdwording update — say the word.sumrange→sum_range, etc.) are the only editorial decisions here; everything else is mechanical.