examples icon indicating copy to clipboard operation
examples copied to clipboard

Starlark impl function naming convention not clear

Open xingao267 opened this issue 6 years ago • 1 comments

It seems not consistent in a lot of places where _impl or <rule_name>_impl should be used as convention for the implementation function name. According to doc here, it should be <rule_name>_impl, but the example given in the same section uses _impl. And the whole doc uses a mix of the two. It caused confusion here https://github.com/bazelbuild/rules_docker/pull/724#discussion_r264527597.

xingao267 avatar Mar 12 '19 15:03 xingao267

Yes. The example is wrong. It should be <rule_name>_impl so that you can have multiple rules in a single .bzl file. Otherwise the naming would be different for single rule vs. multi-rule files.

We always appreciate PRs to correct clear mistakes. Otherwise we'll get around to this in a documentation cleaning pass.

aiuto avatar Mar 13 '19 17:03 aiuto