Skip to content

Commit 50760a4

Browse files
authored
Merge pull request #62 from cvxgrp/pre
pre-commit
2 parents 2e51a57 + 9683867 commit 50760a4

File tree

3 files changed

+13
-21
lines changed

3 files changed

+13
-21
lines changed

.pre-commit-config.yaml

+9-12
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,20 @@ repos:
55
- id: check-toml
66
- id: end-of-file-fixer
77
- id: trailing-whitespace
8-
9-
- repo: https://github.com/psf/black
10-
rev: 24.10.0
11-
hooks:
12-
- id: black
8+
- id: check-yaml
139

1410
- repo: https://github.com/charliermarsh/ruff-pre-commit
1511
rev: 'v0.8.4'
1612
hooks:
1713
- id: ruff
1814
args: [ --fix, --exit-non-zero-on-fix ]
15+
# Run the formatter
16+
- id: ruff-format
1917

2018
- repo: https://github.com/igorshubovych/markdownlint-cli
2119
rev: v0.43.0
2220
hooks:
2321
- id: markdownlint-fix
24-
args: [ "--ignore", "book/**/*.md" ]
2522

2623
- repo: https://github.com/asottile/pyupgrade
2724
rev: v3.19.1
@@ -36,16 +33,16 @@ repos:
3633
- id: check-github-workflows
3734
args: ["--verbose"]
3835

39-
#- repo: https://github.com/python-poetry/poetry
40-
# rev: '1.6.1' # add version here
41-
# hooks:
42-
# - id: poetry-check
43-
# - id: poetry-lock
44-
4536
- repo: https://github.com/Lucas-C/pre-commit-hooks
4637
rev: v1.5.5
4738
hooks:
4839
- id: insert-license
4940
files: ^(cvx)
5041
args:
5142
['--license-filepath', 'copyright.txt', '--no-extra-eol']
43+
44+
- repo: https://github.com/rhysd/actionlint
45+
rev: v1.7.5
46+
hooks:
47+
- id: actionlint
48+
args: [-ignore, SC]

cvx/cli/smallest_eigenvalue.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ def smallest_ev(bson_file) -> Dict[str, float]:
3131
poetry run smallest-eigenvalue cli/data/test.bson
3232
"""
3333

34-
eigenvalues = {
35-
key: np.min(np.linalg.eigh(matrix)[0])
36-
for key, matrix in read_bson(bson_file).items()
37-
}
34+
eigenvalues = {key: np.min(np.linalg.eigh(matrix)[0]) for key, matrix in read_bson(bson_file).items()}
3835

3936
for key, ev in eigenvalues.items():
4037
print(key, ev)

pyproject.toml

+3-5
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,16 @@ dev = [
2727
weather = "cvx.cli.weather:main"
2828
smallest-eigenvalue = "cvx.cli.smallest_eigenvalue:main"
2929

30-
#[build-system]
31-
#requires = ["poetry>=1.6.0"]
32-
#build-backend = "poetry.core.masonry.api"
33-
3430
[tool.ruff]
35-
select = ["E", "F", "I"]
3631
line-length = 120
3732
target-version = "py310"
3833
exclude = [
3934
"*__init__.py"
4035
]
4136

37+
[tool.ruff.lint]
38+
select = ["E", "F", "I"]
39+
4240
[build-system]
4341
requires = ["hatchling"]
4442
build-backend = "hatchling.build"

0 commit comments

Comments
 (0)