Skip to content

Commit 201e06f

Browse files
committed
Add uv-pre-commit
1 parent 1813f7d commit 201e06f

5 files changed

Lines changed: 917 additions & 528 deletions

File tree

‎.pre-commit-config.yaml‎

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@ repos:
1818
hooks:
1919
- id: auto-walrus
2020

21-
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: v0.16.1
23-
hooks:
24-
- id: ruff-check
25-
- id: ruff-format
26-
2721
- repo: https://github.com/codespell-project/codespell
2822
rev: v2.4.3
2923
hooks:
3024
- id: codespell
3125
additional_dependencies:
3226
- tomli
3327

28+
- repo: https://github.com/astral-sh/ruff-pre-commit
29+
rev: v0.16.5
30+
hooks:
31+
- id: ruff-check
32+
- id: ruff-format
33+
3434
- repo: https://github.com/tox-dev/pyproject-fmt
35-
rev: v2.26.0
35+
rev: v2.28.1
3636
hooks:
3737
- id: pyproject-fmt
3838

@@ -44,8 +44,13 @@ repos:
4444
language: script
4545
pass_filenames: false
4646

47+
- repo: https://github.com/astral-sh/uv-pre-commit
48+
rev: 0.12.7
49+
hooks:
50+
- id: uv-lock
51+
4752
- repo: https://github.com/abravalheri/validate-pyproject
48-
rev: v0.25
53+
rev: "0.26"
4954
hooks:
5055
- id: validate-pyproject
5156

‎CONTRIBUTING.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ We want your work to be readable by others; therefore, we encourage you to note
108108
The following are considered to be bad and may be requested to be improved:
109109

110110
```python
111-
x = x + 2 # increased by 2
111+
x = x + 2 # increased by 2
112112
```
113113

114114
This is too trivial. Comments are expected to be explanatory. For comments, you can write them above, on or below a line of code, as long as you are consistent within the same piece of code.
@@ -148,7 +148,7 @@ We want your work to be readable by others; therefore, we encourage you to note
148148
The use of the Python built-in `input()` function is __not__ encouraged:
149149

150150
```python
151-
input('Enter your input:')
151+
input("Enter your input:")
152152
# Or even worse...
153153
input = eval(input("Enter your input: "))
154154
```

‎linear_algebra/matrix_inversion.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def invert_matrix(matrix: list[list[float]]) -> list[list[float]]:
1212
list[list[float]]: Inverted matrix if invertible, else raises error.
1313
1414
>>> invert_matrix([[4.0, 7.0], [2.0, 6.0]])
15-
[[0.6000000000000001, -0.7000000000000001], [-0.2, 0.4]]
15+
[[0.6, -0.7000000000000001], [-0.2, 0.4]]
1616
>>> invert_matrix([[1.0, 2.0], [0.0, 0.0]])
1717
Traceback (most recent call last):
1818
...

‎physics/in_static_equilibrium.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ def in_static_equilibrium(
4545
[x1, y1],
4646
[x2, y2],
4747
....]
48-
>>> force = array([[1, 1], [-1, 2]])
49-
>>> location = array([[1, 0], [10, 0]])
48+
>>> force = array([[1, 1], [-1, 2], [0, 3]])
49+
>>> location = array([[1, 0], [10, 0], [5, 0]])
5050
>>> in_static_equilibrium(force, location)
5151
False
5252
"""

0 commit comments

Comments
 (0)