conan-io / hooks

Official Conan client hooks
MIT License
33 stars 46 forks source link

[conan center] generic check for undocummented APIs #176

Open SSE4 opened 4 years ago

SSE4 commented 4 years ago

is it somehow possible more or less generic checks for undocumented APIs in recipes? we had some issues with it previously, e.g.: https://github.com/conan-io/conan-center-index/pull/1293#discussion_r408189278 https://github.com/conan-io/conan-center-index/pull/1284 maybe we can avoid such kind of issues possible methods:

suggestions are welcomed

/cc @uilianries @jgsogo

jgsogo commented 4 years ago

Probably this is something to do using a linter, together with other checks that are currently implemented in the hooks. Probably it is the easiest way and it should cover 100% of the scenarios, other approaches with regex/find always have exceptions.

jgsogo commented 4 years ago

Not sure if this should be enough with a file in conans/pylint_plugin.py or there would be some specific errors here and we will need to maintain another file in this repo

jgsogo commented 4 years ago

btw, I totally support using regex/find strategies while we add the linter to the pipeline (this is something I've already talked with @uilianries in some PRs here but we couldn't find time to do it) 😓

SSE4 commented 4 years ago

@jgsogo do you have an example of how we can implement such a check with conans/pylint_plugin.py? will we need to maintain black/white list of functions in Conan codebase? will we need to somehow mark API functions in Conan codebase? can we just assume regular functions are public API, but something with one or two underscores is private?

jgsogo commented 4 years ago

Maybe we need a plain pylint_plugin adding only the objects and methods we allow in ConanCenter and run pylint in a Python environment without Conan installed