mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 15:08:51 +00:00
python code style docs
This commit is contained in:
@@ -0,0 +1,20 @@
|
|||||||
|
Code style
|
||||||
|
============
|
||||||
|
|
||||||
|
|
||||||
|
Black code formatter
|
||||||
|
-------------------------------
|
||||||
|
For Python code formatting, we use `Black code formatter <https://pypi.org/project/black/>`__ with ``--line-length 120``.
|
||||||
|
|
||||||
|
``black`` can be installed using ``pip install black`` and files can be formatted with the following example command:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
black --line-length 120 src/blenderbim/blenderbim/bim/module/qto/operator.py
|
||||||
|
|
||||||
|
Using PowerShell, you can run the Black formatter on the last commit in the repository.
|
||||||
|
You can change ``~1`` to ``~n`` to affect ``n`` commits.
|
||||||
|
|
||||||
|
.. code-block:: powershell
|
||||||
|
|
||||||
|
git diff HEAD HEAD~1 --name-only | where {$_ -like "*.py"} | foreach-object { start $_ && black --line-length 120 $_ }
|
||||||
@@ -40,6 +40,7 @@ Learn how to model a small building and create simple architectural plans, secti
|
|||||||
|
|
||||||
devs/installation
|
devs/installation
|
||||||
devs/hello_world
|
devs/hello_world
|
||||||
|
devs/code_style
|
||||||
devs/running_tests
|
devs/running_tests
|
||||||
devs/writing_docs
|
devs/writing_docs
|
||||||
devs/translations
|
devs/translations
|
||||||
|
|||||||
Reference in New Issue
Block a user