Skip to content

Commit 6ce0be1

Browse files
authored
Merge pull request #1332 from compas-dev/update-format-settings
Update format settings
2 parents 87e53f9 + bdc2718 commit 6ce0be1

File tree

287 files changed

+972
-1229
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

287 files changed

+972
-1229
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ insert_final_newline = true
88
indent_style = space
99
indent_size = 4
1010
charset = utf-8
11-
max_line_length = 120
11+
max_line_length = 179
1212

1313
[*.{bat,cmd,ps1}]
1414
end_of_line = crlf

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
* Added `compas.tolerance.Tolerance.angulardeflection`.
1616

1717
### Changed
18+
1819
* Changed and update the `compas_view2` examples into `compas_viewer`.
1920
* Changed and updated the `compas_view2` examples into `compas_viewer`.
2021
* Changed `compas.scene.Scene` to inherent from `compas.datastructrues.Tree`.
@@ -25,8 +26,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2526
* Fixed bug in `Mesh.thickened`.
2627
* Fixed various bugs in `compas.geometry.Quaternion`.
2728
* Changed repo config to `pyproject.toml`.
28-
* `RhinoBrep.trimmed` returns single result or raises `BrepTrimmingError` instead of returning a list.
29-
29+
* Changed `RhinoBrep.trimmed` to return single result or raise `BrepTrimmingError` instead of returning a list.
30+
* Changed order of imports according to `isort` and changed line length to `179`.
3031

3132
### Removed
3233

docs/devguide/code.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ Naming conventions
7171
Line length
7272
-----------
7373

74-
**COMPAS uses a line length of 120 characters**. While longer than the 80 characters recommended by ``PEP8``, it is in our opinion a more reasonable limit for modern displays.
75-
This is enforced and can be automatically set using ``black -l 120``.
74+
**COMPAS uses a line length of 180 characters**. While longer than the 80 characters recommended by ``PEP8``, it is in our opinion a more reasonable limit for modern displays.
7675

7776
**Indentations are 4 spaces**. Tab to spaces setting can be set in ``.editorconfig`` which is respected by most editors. For more information see `EditorConfig <https://editorconfig.org/>`_.
7877

docs/devguide/workflow.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ To set up a developer environment
2222
.. code-block:: bash
2323
2424
cd path/to/compas
25-
pip install -r requirements-dev.txt
25+
pip install -e ".[dev]"
2626
2727
4. Make sure all tests pass and the code is free of lint:
2828

pyproject.toml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,20 +118,15 @@ replace = "[{new_version}] {now:%Y-%m-%d}"
118118
# ============================================================================
119119

120120
[tool.black]
121-
# we should set this to 179
122-
line-length = 120
121+
line-length = 179
123122

124123
[tool.ruff]
125-
# we should set this to 179
126-
line-length = 120
124+
line-length = 179
127125
indent-width = 4
128126
target-version = "py39"
129127

130128
[tool.ruff.lint]
131-
# we should add "I"
132-
select = ["E", "F"]
133-
# we should remove this
134-
ignore = ["E501"]
129+
select = ["E", "F", "I"]
135130

136131
[tool.ruff.lint.per-file-ignores]
137132
"__init__.py" = ["I001"]
@@ -151,8 +146,7 @@ known-first-party = [
151146
convention = "numpy"
152147

153148
[tool.ruff.lint.pycodestyle]
154-
# we should set this to 179
155-
max-doc-length = 120
149+
max-doc-length = 179
156150

157151
[tool.ruff.format]
158152
docstring-code-format = true

src/compas/_iotools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""For the time being, these functions are only for internal use."""
22

3-
from contextlib import contextmanager
43
import io
4+
from contextlib import contextmanager
55

66
try:
77
from urllib.request import urlopen

src/compas/_os.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,8 @@ def _get_win_folder_from_registry(csidl_name):
677677

678678

679679
def _get_win_folder_with_pywin32(csidl_name):
680-
from win32com.shell import shellcon, shell
680+
from win32com.shell import shell
681+
from win32com.shell import shellcon
681682

682683
dir = shell.SHGetFolderPath(0, getattr(shellcon, csidl_name), 0, 0)
683684
# Try to make this a unicode path because SHGetFolderPath does

src/compas/colors/colordict.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from __future__ import print_function
21
from __future__ import absolute_import
32
from __future__ import division
3+
from __future__ import print_function
44

55
from compas.data import Data
6+
67
from .color import Color
78

89

src/compas/colors/colormap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
from compas.itertools import linspace
88

99
from .color import Color
10-
from .mpl_colormap import _magma_data
1110
from .mpl_colormap import _inferno_data
11+
from .mpl_colormap import _magma_data
1212
from .mpl_colormap import _plasma_data
1313
from .mpl_colormap import _viridis_data
1414

src/compas/data/coercion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from __future__ import print_function
21
from __future__ import absolute_import
32
from __future__ import division
3+
from __future__ import print_function
44

55
from .validators import is_item_iterable
66

0 commit comments

Comments
 (0)