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
Now that Flake8 3.0 is released and our old API is considered "legacy" (and deprecated of sorts), let's work together to design a Python API that is powerful and elegant and extensible.
@asottile thank you for expressing your frustration. Given cheetah-lint has the most complex of use-cases I've seen of anyone using, would you provide some use cases for cheetah lint? What do you need to do with flake8?
From your myriad of other issues it seems you need a way to provide lines to be checked. What else?
For what it's worth, I didn't want to redesign a new API because I have zero use for one. I wanted users to help provide the use cases for the API so users could have a say in what the stable API was. I also don't want users forcing us into API by importing things like was done with flake8.engine.
I think the only thing I need from flake8 is a way to pass in source lines and receive a datastructure containing error codes. I was (admittedly) hackily doing this in 2.x by creating my own formatter and passing it through.
cheetah-lint essentially takes a python-like templating language which compiles into python, compiles source files into python and then passes the python through flake8. This makes it pretty easy to plug in existing python linting plugins targetting flake8 and utilize them to lint the templates. You could imagine a similar setup to lint other template->python languages such as mako.
I think having a way to use Flake8 Similar to PyLint would help a lot already: -f json for JSON output, pylint.lint.Run(..., exit=False) can run pylint on files (though output is sent to stdout), but I'd say starting with simple things like this in the API would be a great start, and later on we could implement the more "complex" tasks.
Running Flake8 on strings (or maybe even byte-like) would be a great improvement. Further improvements could be, as mentioned before, JSON output. To add to that, having a way to manually 'step' through lines in a file would give extensions and/or users access to more advanced ways of processing the data Flake8 returns.
Activity
asottile commentedon Apr 3, 2021
In GitLab by @sigmavirus24 on Aug 3, 2016, 06:31
Some feedback from twitter:
asottile commentedon Apr 3, 2021
In GitLab by @sigmavirus24 on Aug 10, 2016, 17:35
@xZise what about adding an equivalent to
stdin_get_valueto the new public API for Flake8?asottile commentedon Apr 3, 2021
In GitLab by @asottile on Aug 24, 2016, 16:23
I'm saddened and frustrated that the old api was removed without any working replacement :(
asottile commentedon Apr 3, 2021
In GitLab by @sigmavirus24 on Aug 27, 2016, 10:07
@asottile thank you for expressing your frustration. Given cheetah-lint has the most complex of use-cases I've seen of anyone using, would you provide some use cases for cheetah lint? What do you need to do with flake8?
From your myriad of other issues it seems you need a way to provide lines to be checked. What else?
asottile commentedon Apr 3, 2021
In GitLab by @sigmavirus24 on Aug 27, 2016, 10:08
For what it's worth, I didn't want to redesign a new API because I have zero use for one. I wanted users to help provide the use cases for the API so users could have a say in what the stable API was. I also don't want users forcing us into API by importing things like was done with
flake8.engine.asottile commentedon Apr 3, 2021
In GitLab by @asottile on Aug 27, 2016, 10:42
I think the only thing I need from flake8 is a way to pass in source lines and receive a datastructure containing error codes. I was (admittedly) hackily doing this in 2.x by creating my own formatter and passing it through.
cheetah-lint essentially takes a python-like templating language which compiles into python, compiles source files into python and then passes the python through flake8. This makes it pretty easy to plug in existing python linting plugins targetting flake8 and utilize them to lint the templates. You could imagine a similar setup to lint other template->python languages such as mako.
asottile commentedon Apr 3, 2021
In GitLab by @sigmavirus24 on Dec 31, 2017, 16:59
asottile/yesqa#1
asottile commentedon Apr 3, 2021
In GitLab by @sigmavirus24 on Jan 1, 2018, 04:20
asottile/yesqa#1 (comment)
asottile commentedon Apr 3, 2021
In GitLab by @Martmists on Jan 20, 2018, 08:04
I think having a way to use Flake8 Similar to PyLint would help a lot already:
-f jsonfor JSON output,pylint.lint.Run(..., exit=False)can run pylint on files (though output is sent to stdout), but I'd say starting with simple things like this in the API would be a great start, and later on we could implement the more "complex" tasks.Running Flake8 on strings (or maybe even byte-like) would be a great improvement. Further improvements could be, as mentioned before, JSON output. To add to that, having a way to manually 'step' through lines in a file would give extensions and/or users access to more advanced ways of processing the data Flake8 returns.
nbirillo commentedon Sep 29, 2022
asottile commentedon Sep 29, 2022
nbirillo commentedon Sep 29, 2022
asottile commentedon Sep 29, 2022
buhtz commentedon Jan 16, 2023