hooks icon indicating copy to clipboard operation
hooks copied to clipboard

[conan center] generic check for undocummented APIs

Open SSE4 opened this issue 5 years ago • 5 comments

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:

  • check for black/white -listed namespaces/imports? (e.g. conans.client.build might be black-listed)
  • somehow export list of public APIs from Conan codebase or Conan docs?

suggestions are welcomed

/cc @uilianries @jgsogo

SSE4 avatar Apr 14 '20 17:04 SSE4

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 avatar Apr 14 '20 17:04 jgsogo

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 avatar Apr 14 '20 18:04 jgsogo

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) 😓

jgsogo avatar Apr 14 '20 18:04 jgsogo

@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?

SSE4 avatar Apr 14 '20 18:04 SSE4

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

jgsogo avatar Apr 14 '20 18:04 jgsogo