openpilot icon indicating copy to clipboard operation
openpilot copied to clipboard

static analysis for Cython modules

Open sshane opened this issue 2 years ago • 5 comments

  • [ ] should autogen stubs, or support parsing Cython code directly
  • [ ] run on all files/code (no need for function to already be typed like mypy requires)

sshane avatar Aug 11 '23 21:08 sshane

Hi @sshane, I'm interested in working on this issue.

As I'm new to the whole openpilot community, could you help me out and give a bit broader explanation regarding the requirements for this static analysis?

For example. what type of static analysis are you looking for (syntax, semantics, data flow, etc.)? Is this something that is supposed to run as a pre-commit hook test, as a standalone test, or as a CI test (where in the project tree should I place this test)?

Thanks in advance!

belimedo avatar Feb 12 '24 12:02 belimedo

the linting is useful but this issue was for adding type hints to the cython modules, so you can get autocomplete for these modules

jnewb1 avatar Feb 19 '24 20:02 jnewb1

the linting is useful but this issue was for adding type hints to the cython modules, so you can get autocomplete for these modules

Ahhhh, alright. Got it now. So something like this in this discussion on the Cython GH: https://github.com/cython/cython/issues/2587. I will take a deeper look at it, but so far it seems that this tool might solve what you need: https://github.com/Vizonex/CyStub

If you can, please elaborate a bit more on what you are looking for, and if I understood it correctly now. Thanks in advance!

belimedo avatar Feb 19 '24 20:02 belimedo

I think you understand correctly, we'd like to be able to make stubs for these modules to get autocomplete

jnewb1 avatar Feb 19 '24 21:02 jnewb1

Hi @sshane, @jnewb1, @adeebshihadeh, I think I managed to improve one of the existing parsers to fit your needs, please take a look at this PR - https://github.com/commaai/openpilot/pull/32274

teodoramilanovic avatar Apr 22 '24 10:04 teodoramilanovic