ometrics step 2
Context
A significant part of a review consists in making sure that the adding code complies with coding rules. Actually, this is the first step. For most of the mainstream programming languages, this task is delegated to linter and light static analyzers. For OCaml, most of the existing tools are either prototypes, still under design, or tackle a smaller subset of OCaml than the one featured by the Tezos codebase.
Description
ometric aims at computing metrics on OCaml code, based on merlin analysis. It enables metrics comparison between 2 versions (i.e. in a merge request). In particular, ometrics focuses on the compliance of adding codes with respect to coding rules. A first PoC can be found here: https://gitlab.com/lthms/ometrics This first version focuses on the docstring documentation of functions' signature in API files, and could already be usable for the Merge Team to help them uncover missing docstrings.
Benefits
Part of a code review is ensuring that the adding codes comply with the coding rules. The lack of tooling regarding these rules has proven to be an issue for Tezos development, either because reviewers have to spend a significant amount of effort to verify them manually, or because developers complain these rules are hard to discover and learn.
ometrics works by comparing two git versions, to try to reduce the number of alerts. If something is found in a MR, and not fixed at merge time, we consider it was a false positive and should not be reported again.
Goal
This project aims at continuing the efforts of the Milestones: ometrics step 1 by detecting non-updated documentation of functions in mli files. This first version is expected to provide a strong foundation to move forwards with more (advance) analysis in the future by detecting undocumented functions.
Tasks and Predicted Efforts
- 1 p.w: Refactor ometrics to handle multiple types of analysis
- 3 p.w: Detect modified functions' signature with not-updated documentation