[PTRun][UnitConverter]Add support for `sq` prefix for square units
Summary of the Pull Request
Adds support for using sq instead of ^2, for example sqcm instead of cm^2.
PR Checklist
- [x] Closes: #37553, #37648
- [ ] Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
- [x] Tests: Added/updated and all pass
- [x] Localization: All end user facing strings can be localized
- [x] Dev docs: No need
- [x] New binaries: None
- [ ] Documentation updated: Not yet
Detailed Description of the Pull Request / Additional comments
- Replaces
sqwith²if before a unit that can be square. - Works for the following units: s, μm, mm, cm, dm, m, km, mil, in, ft, yd, mi, nmi, ft (US)
- Unlike the original PR, this also works with more complex units, such as
m/sqsinstead ofm/s^2.
Validation Steps Performed
Added tests, manually tested a bunch of units
@check-spelling-bot Report
:red_circle: Please review
See the :open_file_folder: files view, the :scroll:action log, or :memo: job summary for details.
Unrecognized words (1)
nmi
These words are not needed and should be removed
ahk AMPROPERTY AMPROPSETID Breadcrumb CDEF comdef ddf devenum DEVMON DEVSOURCE DGR DIIRFLAG dshow DVH DVHD DVSD DVSL EData ERole fdw FILEINFOSIG Filtergraph Filterx HCERTSTORE IKs iljxck IYUV KSPROPERTY lcb ldx lld LONGLONG LTRB majortype makecab MEDIASUBTYPE mediatype mfplat mic mjpg Msimg msiquery ORAW outpin overlaywindow PAUDIO PINDIR Pnp ppmt previouscamera PROPBAG propvarutil reencoded REFGUID REGFILTER REGFILTERPINS REGPINTYPES regsvr shmem sizeread stl strsafe strutil subquery SYNCMFT TMPVAR vcdl vdi vid VIDCAP VIDEOINFOHEADER vih webcam wistd WVCTo accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands
... in a clone of the [email protected]:PesBandi/PowerToys.git repository
on the launcher-unitconvert-square branch (:information_source: how do I use this?):
curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/v0.0.24/apply.pl' |
perl - 'https://github.com/microsoft/PowerToys/actions/runs/13766250399/attempts/1'
If the flagged items are :exploding_head: false positives
If items relate to a ...
-
binary file (or some other file you wouldn't want to check at all).
Please add a file path to the
excludes.txtfile matching the containing file.File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.
^refers to the file's path from the root of the repository, so^README\.md$would exclude README.md (on whichever branch you're using). -
well-formed pattern.
If you can write a pattern that would match it, try adding it to the
patterns.txtfile.Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.
Note that patterns can't match multiline strings.
LGTM.
But, could you please add at least one picture in the description to show the usage of your new units format?
/azp run
Azure Pipelines successfully started running 1 pipeline(s).
Hi @moooyo, thanks for the review. I've added some screenshots to the description, you can check them out.
Do you think I should mention this in the docs?
Do you think I should mention this in the docs?
I believe so. It's better.