errata-ai / vale

:pencil: A markup-aware linter for prose built with speed and extensibility in mind.
https://vale.sh
MIT License
4.44k stars 153 forks source link

Vale does not report the correct replacement term #802

Closed aireilly closed 5 months ago

aireilly commented 5 months ago

Check for existing issues

Environment

$ vale -v vale version 3.4.0

Fedora Linux 39 (Workstation Edition)

Describe the bug / provide steps to reproduce it

Vale does not report the correct replacement term when the replacement term is the same as the error term with different capitalization.

Example Vale rule that shows this error:

---
extends: substitution
ignorecase: false
level: error
message: "Use %s rather than %s."
action:
  name: replace
swap:
  Mutual TLS: mutual TLS
  VNIC: vNIC

Example output:

┌───── ~/vale-test (vale-test-4)
$ vale -v
vale version 3.4.0

┌───── ~/vale-test (vale-test-4)
$ vale .

 modules/vale-test.adoc
 3:108  error  Use 'Mutual TLS' rather than    RedHat.Test 
               Mutual TLS.                                 
 5:16   error  Use 'VNIC' rather than VNIC.    RedHat.Test 

✖ 2 errors, 0 warnings and 0 suggestions in 2 files.

Vale CLI and SublimeText + vale-ls both show the error. Clone aireilly/vale-test to replicate:

git clone -b vale-test-4 https://github.com/aireilly/vale-test && cd vale-test && vale .