Skip to content

Add ability to use ~ for a shorthand operator

Laura Montemayor requested to merge add-shorthand-range-tilde-op into master

What does this MR do and why?

Add ability to use a tilde ~ as a shorthand operator for fetching latest minor/patch versions.

Example: ~1.2

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Before

Screenshot_2024-04-22_at_20.05.18

After

two digits:

Screenshot_2024-04-22_at_20.05.51

one digit:
Screenshot_2024-04-22_at_20.05.59

This is NOT a breaking change, so it still works without the operator:

Screenshot 2024-04-22 at 20.10.09.png

How to set up and validate locally

include a component with a ~x version like the screenshots above, and see that the correct version gets referenced and the linter shows no errors:sparkles:

Resolves: #455836 (closed)

Edited by Laura Montemayor

Merge request reports