You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a large project, I would like not to check it all. I only want to check the changed files. AndroidLint haven't that feature. I need to write wrapper to implement it. It can be cool, if i can use AndroidLint from spotless with git ratchet feature.
Sounds great. So i think. detekt should be implemented with that model String -> Optional<ErrorMsgAndLocation>. It can be cool, if you can help me with LintStep infrastructure.
In fact ktlint is linter too, not only formatter. May be more correct abstraction for spotless is str -> Pair<str, issue[]>, where left is autofixed issues, right is list of issues which used sould fixed manually.
Or we shoud create two kind of aggregation? Formatter and Linter.
where, Formatter is pure function str -> str, Linter is pure function str -> Pair<str, issue[]>.
Activity
nedtwigg commentedon Jan 12, 2022
It doesn't, but we'd be happy to take a PR which adds it. In this and #143 you're proposing adding support for linting tools rather than formatters.
A key thing to understand about Spotless' current model is that a
FormatterStepis just aString -> String(more details here).Perhaps we could create a new infrastructure for linters like so:
We could then add a
List<LintStep> lintStepstoFormatterspotless/lib/src/main/java/com/diffplug/spotless/Formatter.java
Lines 45 to 46 in c66f83e
A computed result would become
String cleanTxt, List<Lint> lintsOnCleanTxt.Whenever adding a big feature like that, I think it's key to have at least two actual clients and ideally three. We now have:
So I think that's enough to test this out. If anyone is interested in writing something along these lines I'd be happy to help them.
rougsig commentedon Jan 12, 2022
Sounds great. So i think. detekt should be implemented with that model
String -> Optional<ErrorMsgAndLocation>. It can be cool, if you can help me with LintStep infrastructure.nedtwigg commentedon Jan 12, 2022
I'll push up a draft PR for the infrastructure of this.
rougsig commentedon Jan 13, 2022
In fact ktlint is linter too, not only formatter. May be more correct abstraction for spotless is
str -> Pair<str, issue[]>, where left is autofixed issues, right is list of issues which used sould fixed manually.Or we shoud create two kind of aggregation? Formatter and Linter.
where, Formatter is pure function
str -> str, Linter is pure functionstr -> Pair<str, issue[]>.nedtwigg commentedon Jan 14, 2022
A PR against #1097 would be very welcome, for any of the linters discussed :)
[-]AndroidLint support[/-][+]Support Android Lint[/+]