mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-18 19:30:25 +00:00
Introduce Ruff github CI with some basic linter rules
And also to help catching syntax errors on older Python versions.
This commit is contained in:
@@ -2,7 +2,7 @@ Code style
|
||||
============
|
||||
|
||||
|
||||
Black code formatter
|
||||
Code formatters
|
||||
-------------------------------
|
||||
For Python code formatting, we use `Black code formatter <https://pypi.org/project/black/>`__,
|
||||
black settings are stored in the repository's pyproject.toml.
|
||||
@@ -19,3 +19,17 @@ We have GitHub workflow `ci-black-formatting` to maintain black formatting acros
|
||||
# Format only some specific file.
|
||||
black src/bonsai/bonsai/bim/module/qto/operator.py
|
||||
|
||||
|
||||
There is also `ruff` with some basic linter rules (checked automatically by the same Github workflow).
|
||||
Which also helps maintaining consistency across the code base
|
||||
and ensure new Python syntax doesn't break code on older Python versions.
|
||||
|
||||
``ruff`` can be installed using ``pip install ruff`` and files can be formatted with the following example commands:
|
||||
|
||||
.. code-block:: bash
|
||||
# Check issues for the entire repository.
|
||||
ruff check
|
||||
# Apply some automatic fixes, if available.
|
||||
ruff check --fix
|
||||
# Check only some specific file.
|
||||
ruff src/bonsai/bonsai/bim/module/qto/operator.py
|
||||
|
||||
@@ -13,6 +13,7 @@ keywords = ["IFC", "Blender", "BIM"]
|
||||
classifiers = [
|
||||
"Programming Language :: Python :: 3",
|
||||
]
|
||||
requires-python = ">=3.11"
|
||||
dependencies = [
|
||||
"ifcopenshell",
|
||||
]
|
||||
@@ -28,3 +29,6 @@ exclude = ["test*"]
|
||||
|
||||
[tool.setuptools.package-data]
|
||||
"*" = ["*.*", "libs/desktop/bonsai", "libs/bin/ifcmerge"]
|
||||
|
||||
[tool.ruff]
|
||||
extend = "../../pyproject.toml"
|
||||
|
||||
@@ -36,3 +36,6 @@ include = ["ifcopenshell*"]
|
||||
|
||||
[tool.setuptools.package-data]
|
||||
"*" = ["*.*"]
|
||||
|
||||
[tool.ruff]
|
||||
extend = "../../pyproject.toml"
|
||||
|
||||
Reference in New Issue
Block a user