Skip to content

Commit

Permalink
cleanup and move to .ruff.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
CagtayFabry committed Jun 4, 2024
1 parent 8b86cae commit d347f30
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 23 deletions.
20 changes: 0 additions & 20 deletions .flake8

This file was deleted.

81 changes: 81 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Exclude a variety of commonly ignored directories.
extend-exclude = [
"__init__.py",
"doc/src/conf.py",
]

# Same as Black.
line-length = 88
indent-width = 4

# Assume Python 3.9
target-version = "py39"


[lint]
# TODO: should be the following list, but Ruff does not yet impl all of them.
# W503,W504
# E203
# C408
ignore = [
"C408",
#"E203",
"E402",
#"W503",
#"W504",
"D203",
"D211",
"D213",
"UP006",
"UP007", # see ruff GH#4427
]
select = [
"B", # flake8-bugbear
"C", # flake8-comprehensions
#"D", # note: all relevant D's will be set by setting pydocstyle.convention=numpy!
"E", # pycodestyles
"F", # pyflakes
"W", # pycodestyle warnings
"UP", # pyupgrade
"T2", # flake8-print
"I001", # isort
"ICN", # import conventions, e.g. import numpy as np
#"B950", # not yet implemented by Ruff.
"RUF100", # ensure 'noqa' declarations are still valid.
]

[lint.extend-per-file-ignores]
# Allow pydocstyle violations in certain areas.
"**/{tests,tags,asdf,devtools}/**" = [
"D",
]
"conftest.py" = [
"D",
]
"doc/src/tutorials/*" = [
"D",
]
"doc/src/conf.py" = [
"E501", # ignore long lines.
"RUF100", # do no check if 'noqa' is needed (circular import workaround)
]
"**/{cli,tests,tutorials,devtools}/**/*{.py,ipynb}" = [
"T2",
] # Allow prints in certain areas.

[lint.pydocstyle]
convention = "numpy"

[lint.mccabe]
max-complexity = 15 # max branches inside a function.

[lint.isort]
known-first-party = [
"weldx",
]
required-imports = [
"from __future__ import annotations",
]

[flake8-import-conventions]
extend-aliases = { xarray = "xr" }
2 changes: 1 addition & 1 deletion doc/src/tutorials/timeseries_01.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We can also use `Quantites` with the appropriate dimension as Inputs for our interpolation:"
"We can also use `Quantities` with the appropriate dimension as Inputs for our interpolation:"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@
"metadata": {},
"source": [
"The `SpatialData` class we used above is mostly a container class for 3d data.\n",
"Additionally to pure point data, it can also store connectivety data in form of triangles.\n",
"Additionally to pure point data, it can also store connectivity data in form of triangles.\n",
"Consult the [class documentation](https://weldx.readthedocs.io/en/latest/_autosummary/weldx.SpatialData.html#weldx.SpatialData) for further information.\n",
"Now we add the data to the CSM:"
]
Expand Down
2 changes: 1 addition & 1 deletion weldx/asdf/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def software_history_entry(self):
Examples
--------
Let us define a custom softare entry and use it during file creation.
Let us define a custom software entry and use it during file creation.
>>> import weldx
>>> software = dict(name="MyFancyPackage", author="Me",
Expand Down

0 comments on commit d347f30

Please sign in to comment.