-
Notifications
You must be signed in to change notification settings - Fork 754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
missing description of public interface in documentation #1214
Comments
third method on StyleGuide from your link? |
This is a big step forward. But the 3rd method |
You can provide your own report class to capture them. It needs only implement what is documented for BaseReport |
Sorry, but I don't see any documented method in
But the file name or the trailing text might contain a If I am expected to create a subclass of |
a bit annoying to need to repeat what was said above: you need to write a subclass of Base report |
@jimka2001 If you subclass BaseReport you can add whatever additional attributes you want to store the issues and methods you like to return them to you. We have an API that maybe isn't the best documented but it will allow you to do exactly what you want. If you don't want to put in that work, you can instead use |
No need to be annoyed, just state plainly that what I'm trying to do is impossible with the currently documented interface. If I understand your terse response, I'd have to implement a subclass at the application level, which cannot use the publicly documented interface but rather depends on internal implementation details which may change in future releases and render the application code incompatible. |
it's literally not impossible. I've done it before but you haven't even showed your attempt so it's a bit frustrating to try and help you when you're in "give me the code" mode |
@jimka2001 It seems like you're engaging in a bad faith discussion here. You want something similar, and when provided with an interface that has stayed stable for something like a decade, you're accusing us of providing you something we intend to break. What you're attempting to do is far from impossible. It's just not possible with a single function in the API. As a result, I'm locking this. |
I don't see from the documentation (https://pycodestyle.pycqa.org/en/latest/api.html) how to call pycodestyle programmatically. I'd like to call a function, pass the path of a python file, and get back a list/set/iterable/collection of PEP issues, either strings, or objects from which I can extract a string.
Is there such a function/method? Is it in the documentation, or is it missing?
The only way I can figure out how to do this is to use
process.Popen(['pycodestyle', the_file_name])
, or if on windowsprocess.Popen(['python', '-m', 'pycodestyle', the_file_name])
because pip on windows does not seem to installpycodestyle
in the executable path. (maybe I'm reaching the wrong conclusion with regard to windows, as I'm not a windows expert).This seems to be a very strange public interface, so I suspect there is an easier way. It would be nice if the public interface to obtaining the PEP issues programmatically didn't have to include OS specific checks in user code.
The text was updated successfully, but these errors were encountered: