[PATCH] D143852: [docs] Add Python coding standard to documentation

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 22 16:13:40 PDT 2023


JDevlieghere added inline comments.


================
Comment at: llvm/docs/CodingStandards.rst:111-119
+The current minimum version of Python required is 3.6. Python code in the LLVM
+repository should only use language features available in this version of Python.
+
+The Python code within the LLVM repository should adhere to the formatting guidelines
+outlined in `PEP-8 <https://peps.python.org/pep-0008/>`_.
+
+We recommend automatic code reformatting with the `black <https://github.com/psf/black>`_
----------------
jhenderson wrote:
> MatzeB wrote:
> > We already specify the python version in `GettingStarted.rst` repeating it here increases the chances that it will get missed and be outdated on the next version bump. So maybe it would be better to not mention any version numbers for `python` and `black` here (and possibly link to `GettingStarted.rst`)?
> I think it's okay to mention the version number of `black` here, since it is the only place `black` will be mentioned in the docs. I agree on the `python` verison though.
Agreed with James


================
Comment at: llvm/docs/CodingStandards.rst:117
+
+We recommend automatic code reformatting with the `black <https://github.com/psf/black>`_
+utility. Black allows changing the formatting rules based on major version. In order
----------------
Is "recommend" strong enough? I was looking for similar wording related to `clang-format` but it doesn't seem to be part of the coding standards? How about something like:

> For consistency and to limit churn, code should be automatically formatted with the black utility. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143852/new/

https://reviews.llvm.org/D143852



More information about the llvm-commits mailing list