Epistemic Status: Sprouting - This is a zettelkasten-style card about a concept I’m interested in remembering.
In Jetbrains IDEs like PyCharm, we can set up File Watchers to run things like linters and formatters at file-save time. Normally this just outputs the results of the lint, but doesn’t provide easy to click links to the lines of code that caused the problem.
Using the Advanced Setting - Output Filters, we can specify a regular expression to use to pull out the file and line information. For example, the ruff check output lists the filename, line, and column like this along with other details:
--> __init__.py:1:1
Setting the Output Filters as follows will turn the __init__.py into a link to that file on line 1, column 1.
--> $FILE_PATH$:$LINE$:$COLUMN$
There’s also an option for pulling out the message, and that might be doable, but since ruff outputs on multiple lines, I haven’t been successful at getting it to work. What I have here is enough for me right now.