Skip to content

chore: add test for number with underscore parsing#4406

Merged
matthew-dean merged 1 commit intoless:masterfrom
matthew-dean:pr-4374-rebased
Mar 9, 2026
Merged

chore: add test for number with underscore parsing#4406
matthew-dean merged 1 commit intoless:masterfrom
matthew-dean:pr-4374-rebased

Conversation

@matthew-dean
Copy link
Copy Markdown
Member

@matthew-dean matthew-dean commented Mar 9, 2026

Rebased version of #4374 by @Krinkle. Resolves conflicts with current master.

The original PR targeted the old test file locations (packages/test-data/css/_main/variables.css and packages/test-data/less/_main/variables.less), which were reorganized in #4378. This rebased version applies the same test additions to the new locations (packages/test-data/tests-unit/variables/).

Original PR: #4374

Credit: @Krinkle

Summary by CodeRabbit

  • Style
    • Added new icon styling configurations including support for large icon variants and dynamic icon type-based styling in test data.

In Less.js 2.6.0, parsing of dimensions changed so that `5_large`
is seen as one value, instead of as a list containing "5" and "_large".

In updating the Less.php port, we forgot to consider this change
because none of the Less.js 3.13 tests seem to cover this behavior.

Follows-up less#2485.

This adds the test case from less#2462,
as inpired by downstream https://gerrit.wikimedia.org/r/1197310.
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Mar 9, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 28cc1344-3b41-4d4b-a823-525adca1241b

📥 Commits

Reviewing files that changed from the base of the PR and between 774f188 and b328e05.

📒 Files selected for processing (2)
  • packages/test-data/tests-unit/variables/variables.css
  • packages/test-data/tests-unit/variables/variables.less

📝 Walkthrough

Walkthrough

Two test data files receive additive styling rules for a new icon type. A CSS class and its Less variable counterpart are introduced to define styling for a "5_large" icon variant, with no modifications to existing rules.

Changes

Cohort / File(s) Summary
Icon Styling Rules
packages/test-data/tests-unit/variables/variables.css, packages/test-data/tests-unit/variables/variables.less
Adds new .icon-5_large CSS class and corresponding Less variable definition with background-image references to /img/icon/5_large.svg. Both additions follow existing styling patterns with no modifications to existing rules.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A rabbit hops with glee so bright,
New icons added, oh what delight!
Five-size-large now has its place,
With CSS and Less to embrace! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title mentions 'number with underscore parsing' but the changes actually add CSS/Less test rules for a 5_large icon variant, not number parsing tests. Update the title to accurately reflect the actual changes, such as 'chore: add test for icon-5_large styling' or similar, matching the actual CSS/Less additions.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@matthew-dean matthew-dean merged commit b9f67e7 into less:master Mar 9, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants