obsidian-linter icon indicating copy to clipboard operation
obsidian-linter copied to clipboard

FR: Give Users the Option To See Character Count or Count of Rules that Made Updates

Open chrisgrieser opened this issue 3 years ago • 5 comments

Is Your Feature Request Related to a Problem? Please Describe.

Currently, the notice shows us how many characters were added/removed by the linter: Pasted image 2022-08-27 07 58 11

This did make sense early on, where most rules where about removing whitespace. Here, the notice indicated the amount of things linted.

However, by now, the linter has a lot of yaml-related rules, which make the "characters added/removed" notice kind of meaningless. For example, the screenshot above is the result of solely the yaml-key-ordering rule running.

With the new yaml rules, the notice is not informative anymore, since it does not tell me how much has actually changed. 10 characters added and removed could either mean a lot of white-space rules were triggered, or that only one yaml rule was triggered.

Describe the Solution You'd Like

  • Alternative A: disregard yaml-related rule from the character added/removed count
  • Alternative B: instead of counting characters, count the number of rules that have been triggered

I personally would prefer B, but both would achieve the goal of making the notices meaningful again.

chrisgrieser avatar Aug 27 '22 06:08 chrisgrieser

The only problem I see with this is that characters removed and updated is working as intended as it just gives an update on how many changes of each kind happened. I think adding an option to include what rules were triggered is a good option to include. The only problem I see is that it may cause some weirdness on mobile. But that would be due to the potentially high amount of rules that could be triggered.

pjkaufman avatar Sep 02 '22 11:09 pjkaufman

I do like option B in regards to the idea of showing the list of rules that were triggered which is the approach I will likely take to this.

pjkaufman avatar Sep 02 '22 11:09 pjkaufman

The only problem I see is that it may cause some weirdness on mobile. But that would be due to the potentially high amount of rules that could be triggered.

Instead of displaying all rules (which could indeed be a large notification even on desktop), an option to show the number of rules that were triggered could also be a useful alternative. Maybe as an option?

chrisgrieser avatar Sep 02 '22 12:09 chrisgrieser

I could do that. I am just not too sure on what that tells you other than a rule changed something which is the same as the amount of characters updated.

Do you mind explaining why that would make the update notification meaningful?

pjkaufman avatar Sep 02 '22 12:09 pjkaufman

yeah, the issue with the character count is, that the characters changed differs vastly between rules. From my opening post:

10 characters added and removed could either mean a lot of white-space rules were triggered, or that only one yaml rule was triggered.

Counting rules instead of characters would solve this

chrisgrieser avatar Sep 02 '22 12:09 chrisgrieser