diff --git a/llvm/docs/CodingStandards.rst b/llvm/docs/CodingStandards.rst --- a/llvm/docs/CodingStandards.rst +++ b/llvm/docs/CodingStandards.rst @@ -50,6 +50,9 @@ conforming, modern, and portable C++ code as the implementation language of choice. +For automation, build-systems and utility scripts Python is preferred and +is widely used in the LLVM repository already. + C++ Standard Versions --------------------- @@ -102,6 +105,21 @@ please consult `that section of the programmer's manual `_. +Python version and Source Code Formatting +----------------------------------------- + +The current minimum version of Python required is documented in the :doc:`GettingStarted` +section. 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 `_. + +For consistency and to limit churn, code should be automatically formatted with the +`black `_ utility. Black allows changing the formatting +rules based on major version. In order to avoid unecessary churn in the formatting rules +we currently use black version 23.x in LLVM. + Mechanical Source Issues ========================