Skip to content

Commit f6a7685

Browse files
authored
symlink some folders and use ruff for formatting instead of black (#87)
2 parents 6d08806 + bc59492 commit f6a7685

File tree

13 files changed

+13
-165
lines changed

13 files changed

+13
-165
lines changed

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
# Common links that should be available on every page
8585
rst_epilog = """
8686
.. _Diamond Light Source: http://www.diamond.ac.uk
87-
.. _black: https://github.com/psf/black
87+
.. _ruff: https://github.com/astral-sh/ruff
8888
.. _flake8: https://flake8.pycqa.org/en/latest/
8989
.. _isort: https://github.com/PyCQA/isort
9090
.. _pyright: https://microsoft.github.io/pyright/#/

docs/explanations/decisions/0008-use-tox.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ There are a number of things that CI needs to run:
2727

2828
- pytest
2929
- black
30-
- pyright
30+
- mypy
3131
- flake8
3232
- isort
3333
- build documentation
@@ -45,7 +45,7 @@ under pytest that had a plugin, and isort under flake8:
4545
subgraph cluster_0 {
4646
label = "pytest"
4747
"pytest-black"
48-
"pytest-pyright"
48+
"pytest-mypy"
4949
subgraph cluster_1 {
5050
label = "pytest-flake8"
5151
"flake8-isort"
@@ -69,14 +69,14 @@ To address this, the tree was rearranged:
6969
7070
pytest
7171
black
72-
pyright
72+
mypy
7373
subgraph cluster_1 {
7474
label = "flake8"
7575
"flake8-isort"
7676
}
7777
```
7878

79-
If using VSCode, this will still run black, flake8 and pyright on file save, but
79+
If using VSCode, this will still run black, flake8 and mypy on file save, but
8080
for those using other editors and for CI another solution was needed. Enter
8181
[pre-commit](https://pre-commit.com/). This allows hooks to be run at `git
8282
commit` time on just the files that have changed, as well as on all tracked
@@ -87,7 +87,7 @@ $ pre-commit install
8787
```
8888

8989
Finally tox was added to run all of the CI checks including
90-
the documentation build. pyright was moved out of the pre-commit and into tox
90+
the documentation build. mypy was moved out of the pre-commit and into tox
9191
because it was quite long running and
9292
therefore intrusive. tox can be invoked to run all the checks in
9393
parallel with:
@@ -109,7 +109,7 @@ The graph now looks like:
109109
{
110110
label = "tox -p"
111111
pytest
112-
pyright
112+
mypy
113113
"sphinx-build"
114114
subgraph cluster_1 {
115115
label = "pre-commit"
@@ -124,11 +124,11 @@ The graph now looks like:
124124

125125
Now the workflow looks like this:
126126

127-
- Save file, VSCode runs black, flake8 and pyright on it
127+
- Save file, VSCode runs black, flake8 and mypy on it
128128
- Run 'tox -p' and fix issues until it succeeds
129129
- Commit files and pre-commit runs black and flake8 on them (if the
130130
developer had not run tox then this catches some of the most common issues)
131-
- Push to remote and CI runs black, flake8, pyright once on all files
131+
- Push to remote and CI runs black, flake8, mypy once on all files
132132
(using tox), then pytest multiple times in a test matrix
133133

134134
## Consequences

docs/reference/standards.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Code Standards
99

1010
The code in this repository conforms to standards set by the following tools:
1111

12-
- black_ for code formatting
12+
- ruff_ for code formatting
1313
- flake8_ for style checks
1414
- isort_ for import ordering
1515
- pyright_ for static type checking

template/.devcontainer

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../.devcontainer

template/.devcontainer/devcontainer.json

Lines changed: 0 additions & 50 deletions
This file was deleted.

template/.pre-commit-config.yaml

Lines changed: 0 additions & 23 deletions
This file was deleted.

template/.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../.pre-commit-config.yaml

template/.vscode

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../.vscode

template/.vscode/extensions.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

template/.vscode/launch.json

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)