-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch linting/formatting to ruff (#738)
* Move isort,black,flake8 to ruff * Update formatting to latest black style before switch * Lint fixes, both manually and automatic (including unsafe fixes, manually checked)
- Loading branch information
Showing
134 changed files
with
240 additions
and
383 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Switch linting/formatting to ruff. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,69 @@ | ||
[tool.black] | ||
include='\.pyi?$|/SConscript$|/libtbx_config$' | ||
include = '\.pyi?$|/SConscript$|/libtbx_config$' | ||
|
||
[tool.towncrier] | ||
package = "dxtbx" | ||
package_dir = ".." | ||
filename = "CHANGELOG.rst" | ||
issue_format = "`#{issue} <https://github.com/cctbx/dxtbx/issues/{issue}>`_" | ||
|
||
[tool.isort] | ||
sections="FUTURE,STDLIB,THIRDPARTY,CCTBX,DIALS,FIRSTPARTY,LOCALFOLDER" | ||
known_firstparty="dxtbx_*,dxtbx" | ||
known_cctbx="boost,boost_adaptbx,cbflib_adaptbx,cctbx,chiltbx,clipper_adaptbx,cma_es,cootbx,crys3d,cudatbx,fable,fast_linalg,fftw3tbx,gltbx,iota,iotbx,libtbx,mmtbx,omptbx,prime,rstbx,scitbx,simtbx,smtbx,spotfinder,tbxx,ucif,wxtbx,xfel" | ||
known_dials="dials" | ||
profile="black" | ||
|
||
[tool.ruff.lint] | ||
select = ["E", "F", "W", "C4", "I"] | ||
unfixable = ["F841"] | ||
# E501 line too long (handled by formatter) | ||
# E741 Ambiguous variable name (We have lots of meaningful I, L, l) | ||
ignore = ["E501", "E741"] | ||
|
||
[tool.ruff.lint.per-file-ignores] | ||
"installer/**.py" = ["I"] | ||
"**/__init__.py" = ["F401"] | ||
|
||
[tool.ruff.lint.isort] | ||
known-first-party = ["dxtbx_*", "dxtbx"] | ||
required-imports = ["from __future__ import annotations"] | ||
section-order = [ | ||
"future", | ||
"standard-library", | ||
"third-party", | ||
"cctbx", | ||
"first-party", | ||
"local-folder", | ||
] | ||
|
||
[tool.ruff.lint.isort.sections] | ||
"cctbx" = [ | ||
"boost", | ||
"boost_adaptbx", | ||
"cbflib_adaptbx", | ||
"cctbx", | ||
"chiltbx", | ||
"clipper_adaptbx", | ||
"cma_es", | ||
"cootbx", | ||
"crys3d", | ||
"cudatbx", | ||
"fable", | ||
"fast_linalg", | ||
"fftw3tbx", | ||
"gltbx", | ||
"iota", | ||
"iotbx", | ||
"libtbx", | ||
"mmtbx", | ||
"omptbx", | ||
"prime", | ||
"rstbx", | ||
"scitbx", | ||
"serialtbx", | ||
"simtbx", | ||
"smtbx", | ||
"spotfinder", | ||
"tbxx", | ||
"ucif", | ||
"wxtbx", | ||
"xfel", | ||
] | ||
|
||
[tool.mypy] | ||
no_implicit_optional = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.