platers / obsidian-linter

An Obsidian plugin that formats and styles your notes with a focus on configurability and extensibility.
https://platers.github.io/obsidian-linter/
MIT License
1.21k stars 82 forks source link

FR: Check-Only linting #1018

Closed MiloParigi closed 7 months ago

MiloParigi commented 7 months ago

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

Hello all !

When I came across Obisidian Linter, I thought that this plugin was doing exactly this: Verifying that a specific set of rules / criteria is met, and flag the lines/files that don't meet those criteria. In fact, that is the very definition of a linter, as outlined in this previous FR.

Why would you want a check-only linter ?

First and foremost, there can be many non-fixable issues. For example, I want to always have a specific tag for a file in a folder, with a list of attendees to a meeting. Yes, I can use a template, but what about the previous files that were already in the folder ? I want to be able to amend all of them by hand, and chose I'll set in the tags.

Second, sometimes I just want an overview of what is wrong in my repo. It allows me to know if my rules are doing what I want, and what I need to modify in order to have my repo in order.

This is for me the 'natural' way a linter work, just like you would when linting a project using ESLint on VSCode for example.

This would open the door for new rules that can define non-fixable problems

Describe the Solution You'd Like

I want to have a window showing the errors / warnings in the current vault, and/or wavy patterns under the content violating the rules.

Example from VSCode of a warning in the editor

Screenshot 2024-02-24 at 16 32 25

Example from VSCode of the 'problem' panel

Screenshot 2024-02-24 at 16 31 40

Describe Alternatives You've Considered

I've considered using markdown linter in vscode but that defeats the purpose of using Obsidian

Additional Context

I have no experience in Obisidian plugins but would be willing to put some time and efforts to make this happen. It is the last brick that would make using Obisidian perfect for me.

pjkaufman commented 7 months ago

This is definitely something that would be nice to have, but due to the amount of work needed and where my use cases lie, I have not made time to work on this.

It would require updating how rules work to return a start and stop position as well as the suggested change after the change that would be made (if applicable). It would also require either an ItemView or CustomView to make this work. Then getting any kind of display value in the editor would take its own set of editor extensions or othe CM6 components.

So it is possible, but it would take a decent chunk of work before even working on the option to specify whether all rules should default to auto-fix or get user input.

pjkaufman commented 7 months ago

I am not opposed to this feature, but I am not currently able to dedicate much time towards implementing this. I can definitely give some guidance around this if you wanted to tackle this @MiloParigi . But it will likely be challenging and have merge conflicts as new rules or changes get added in the meantime.

pjkaufman commented 7 months ago

This is a duplicate of #272 .

MiloParigi commented 7 months ago

Hi, thanks for responding so quick !

I'll get the discussion going on #272. I'd love to work on this feature, I'll get back to you on 272. I'll close this to avoid duplication.

pjkaufman commented 7 months ago

Sounds good.