Michael WS schrieb am 24.07.2016 um 20:39:
> On Friday, July 22, 2016 at 3:09:08 AM UTC-4, Stefan Behnel wrote:
>> Nelson Liu schrieb am 18.07.2016 um 18:44:
>>> Is there any tool used to lint Cython in the same vein as Python has
>>> pep/flake8? It's difficult to have uniform style for Cython code
>>> throughout
>>> a codebase with many contributors when there isn't an automated tool to
>>> do so for you :)
>>
>> Besides using pure Python mode, this brings back the (ancient) idea of an
>> "uncython" tool, which would strip any cython-only syntax and leave only
>> Python code to be analysed by third party tools. It's not entirely the
>> same
>> thing as a dedicated Cython linter, but it should still work in most
>> cases.
>> It would strip cdef's, types in function signatures and pure declarations,
>> and might also turn things like structs into class declarations or so, to
>> keep as much of the original code as possible.
>>
>> Has anyone ever looked into that?
>
> I am not sure how practical it is to require everyone on a team to use the
> same ide. Also, I need to have pre commits hooks that my team must run.
I'm not sure I understand what you mean. Such a tool would be used as a
preprocessor before running other tools, such as linters. It would
obviously require a bidirectional mapping from Cython code to analysable
Python code and back (well, at least the code positions would have to be
accurate), in order to allow for meaningful output of whatever tool you run
after it. But it would not depend on any specific IDE or so.
I'm not saying this would be trivial. :)
Regarding IDEs, I sat together with a couple of PyCharm developers at
EuroPython this week and it looks like we could easily improve the IDE
support in various ways, such as debugging (stepping through Cython code
worked as a POC) and profiling.
We also discussed integrating the Pure Python syntax with PEP484 type
hints, so that regular Python tools could understand them, at least to a
certain extent. There seems to be a way to do that, although with the usual
limitation of not being able to talk to C libraries in pure mode.
Stefan