Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Inconsistent result depending on random/small variation in a Markdown file #847

Open
1 task done
ccoVeille opened this issue Jun 1, 2024 · 1 comment
Open
1 task done

Comments

@ccoVeille
Copy link
Contributor

ccoVeille commented Jun 1, 2024

Check for existing issues

  • Completed

Environment

Linux
Homebrew
vale 3.4.2

Describe the bug / provide steps to reproduce it

I'm testing a rule to detect GitHub case and suggest fixing it

Here is the rule

---
extends: substitution
message: Use '%s' instead of '%s'
level: warning
ignorecase: true
swap:
  GitHub: GitHub

Here is a test file:

github_test2.md

http://github.com bar

[github](#whatever)
[github1](#whatever)
[github.](#whatever)

https://jwodder.github.io/
http://github.com

whatever

Code reports

  • github.com bar because he wants github.com (not convenient but not related to my bug)
  • [github](#whatever) as it should be [GitHub](#whatever) ✔️
  • [github.](#whatever) as it should be [GitHub.](#whatever) ✔️

github_test3.md

http://github.com bar

[github](#whatever)
[github1](#whatever)
[github.](#whatever)

https://jwodder.github.io/

http://github.com

The only difference is on last line whatever was replaced by http://github.com

Code reports differs:

  • github.com bar is still reported ✔️
  • [github](#whatever) is reported as it should be [GitHub](#whatever) ✔️
  • [github.](#whatever) is no longer reported 🤔 🐛
  • https://jwodder.github.io/ is reported as invalid 🤔 🐛

Now let's change slightly

bar

[github](#whatever)
[github1](#whatever)
[github.](#whatever)

https://jwodder.github.io/

http://github.com

So the on first line github.com was removed

Code reports differs again and seems normal:

  • [github](#whatever) is reported as it should be [GitHub](#whatever) ✔️
  • [github.](#whatever) as it should be [GitHub.](#whatever) ✔️
  • https://jwodder.github.io/ is no longer reported as invalid 🤔 but it's what I would have expected
@ccoVeille
Copy link
Contributor Author

ccoVeille commented Jun 1, 2024

Here are the files

github_test2.md
github_test3.md
github_test4.md
GitHub.yml

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant