djLint
djLint copied to clipboard
[FEATURE] Add optional output formats from linter
- json
- xml
- ?
A lot of lint tools are (ab)using JUnit XML report format, for which there is python library junit-xml
SARIF - Static Analysis Results Interchange Format is an emerging standard for this.
is there also a way to format the output in the console? I am interested to get the output this way it creates clickable links in my IDE
templates/index.html:3:2: T001 Variables should be wrapped in a single whitespace. %}
templates/index.html:5:8: H008 Attributes should be double quoted. class='capitalize w-
@Benoss I suppose it would be possible, but how would it help? You can parse the output, something like this:
regex = (
r"^\s+?(?:(?P
When Pycharm detect something that looks like a relative filepath in the console it automagically creates a link that open the file at the correct line and offset. If the output is with the format above I can click directly to fix the linting issue (already doing it this way for flake8 and mypy)
@Benoss I created #153 for that.
Awesome thanks :)
closing this for now. If a specific format is needed please open a new issue, or a pr.