Skip to content

[aggregate] Support for non-plaintext file formats #1405

@Nytelife26

Description

@Nytelife26

Relevant issues

Supersedes #277, #342, #422, #523, #524, #525, #533, #542, #555, #567, #803, #945, #971, #1355.

Brief

Formats requested so far include (La)TeX, reST, markdown, emails, Python, math blocks, XML, and perhaps programming languages in general.

The problem lies in the execution: supporting these would require incorporating parsers and AST handling for each filetype into proselint itself. That would impose a substantial maintenance burden, bloat the program, and is far beyond proselint's intended scope.

If anybody has suggestions or reference materials on the matter, please do let me know.

Suggestions

In general

It has been suggested in #393 and #443 that the typography checks should be disabled by default to make working with other file formats easier. Alternatively, proselint could disable it by default specifically for non-plaintext files.

A solid general solution would be an external tool that parses these formats and multiplexes linters over relevant AST nodes, similar to how treefmt works with entire files of given types. That would allow proselint, and all other linters, to format segments of files that are relevant to them specifically; be it text, code, or other blocks. I am not aware of any prior art on that front, but it is an interesting consideration. Just in case, though, I know of Rust AST handlers for (La)TeX and markdown that could be integrated after porting.

Markdown

We could consider adding the single and triple backticks used in markdown code blocks to the ignored quote spans regex, which would remedy problems such as in #971.

(La)TeX

@tani (thank you) has suggested external tools that can accomplish this.

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    cat: rfcFeature requests and general proposals

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions