Skip to content

Commit 70eb86e

Browse files
authored
Auto-update pre-commit hooks
1 parent 3b4c511 commit 70eb86e

11 files changed

Lines changed: 25 additions & 23 deletions

File tree

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ default_language_version:
22
python: python3
33
repos:
44
- repo: https://github.com/charliermarsh/ruff-pre-commit
5-
rev: v0.1.13
5+
rev: v0.6.2
66
hooks:
77
- id: ruff
88
args: [--fix]
99
- id: ruff-format
1010
- repo: https://github.com/pre-commit/pre-commit-hooks
11-
rev: v4.5.0
11+
rev: v4.6.0
1212
hooks:
1313
- id: check-yaml
1414
- id: fix-encoding-pragma
1515
args: [--remove]
1616
- id: end-of-file-fixer
1717
- id: trailing-whitespace
1818
- repo: https://github.com/asottile/blacken-docs
19-
rev: 1.16.0
19+
rev: 1.18.0
2020
hooks:
2121
- id: blacken-docs
2222
additional_dependencies: [black]
@@ -29,15 +29,15 @@ repos:
2929
- id: rst-directive-colons
3030
- id: rst-inline-touching-normal
3131
- repo: https://github.com/pre-commit/mirrors-mypy
32-
rev: v1.8.0
32+
rev: v1.11.2
3333
hooks:
3434
- id: mypy
3535
files: ^src/
3636
additional_dependencies:
3737
- tokenize-rt==4.1.0
3838
- types-paramiko
3939
- repo: https://github.com/codespell-project/codespell
40-
rev: v2.2.6
40+
rev: v2.3.0
4141
hooks:
4242
- id: codespell
4343
stages: [commit, commit-msg]

src/atomate2/cli/dev.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Module containing command line scripts for developers."""
22

3-
43
from __future__ import annotations
54

65
from typing import TYPE_CHECKING

src/atomate2/common/schemas/elastic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Schemas for elastic tensor fitting and related properties."""
2+
23
from copy import deepcopy
34
from typing import Optional
45

src/atomate2/cp2k/schemas/task.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Core definition of a CP2K task document."""
2+
23
import logging
34
from collections import OrderedDict
45
from pathlib import Path

src/atomate2/utils/file_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Tools for remote file IO using paramiko."""
22

3-
43
from __future__ import annotations
54

65
import shutil
@@ -403,9 +402,10 @@ def gzip(
403402
)
404403

405404
if host is None:
406-
with open(path, "rb") as f_in, GzipFile(
407-
path_gz, "wb", compresslevel=compresslevel
408-
) as f_out:
405+
with (
406+
open(path, "rb") as f_in,
407+
GzipFile(path_gz, "wb", compresslevel=compresslevel) as f_out,
408+
):
409409
shutil.copyfileobj(f_in, f_out)
410410
shutil.copystat(path, path_gz)
411411
path.unlink()

src/atomate2/vasp/sets/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -597,9 +597,9 @@ def get_kpoints_updates(
597597
kpoints["zero_weighted_line_density"] = self.line_density
598598

599599
elif self.mode == "uniform_dense":
600-
kpoints[
601-
"zero_weighted_reciprocal_density"
602-
] = self.zero_weighted_reciprocal_density
600+
kpoints["zero_weighted_reciprocal_density"] = (
601+
self.zero_weighted_reciprocal_density
602+
)
603603

604604
added_kpoints = deepcopy(self.added_kpoints)
605605
if vasprun is not None and self.mode == "gap":

tests/common/schemas/test_cclib.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ def test_cclib_taskdoc(test_dir):
7373
# Let's try a volumetric analysis
7474
# We'll gunzip the .cube.gz file because cclib can't read cube.gz files yet.
7575
# Can remove the gzip part when https://github.com/cclib/cclib/issues/108 is closed.
76-
with gzip.open(p / "psi_test.cube.gz", "r") as f_in, open(
77-
p / "psi_test.cube", "wb"
78-
) as f_out:
76+
with (
77+
gzip.open(p / "psi_test.cube.gz", "r") as f_in,
78+
open(p / "psi_test.cube", "wb") as f_out,
79+
):
7980
shutil.copyfileobj(f_in, f_out)
8081
doc = TaskDocument.from_logfile(p, "psi_test.out", analysis=["Bader"]).dict()
8182
os.remove(p / "psi_test.cube")

tests/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def clean_dir(debug_mode):
5050
shutil.rmtree(new_path)
5151

5252

53-
@pytest.fixture()
53+
@pytest.fixture
5454
def tmp_dir():
5555
"""Same as clean_dir but is fresh for every test"""
5656

@@ -79,7 +79,7 @@ def lpad(database, debug_mode):
7979
lpad.db[coll].drop()
8080

8181

82-
@pytest.fixture()
82+
@pytest.fixture
8383
def memory_jobstore():
8484
store = JobStore(MemoryStore(), additional_stores={"data": MemoryStore()})
8585
store.connect()
@@ -92,7 +92,7 @@ def log_to_stdout_auto_use():
9292
initialize_logger()
9393

9494

95-
@pytest.fixture()
95+
@pytest.fixture
9696
def si_structure(test_dir):
9797
return Structure.from_file(test_dir / "structures" / "Si.cif")
9898

tests/cp2k/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def cp2k_test_outputs(test_dir):
5656
return Path(test_dir / "cp2k").glob("*/outputs")
5757

5858

59-
@pytest.fixture()
59+
@pytest.fixture
6060
def mock_cp2k(monkeypatch, cp2k_test_dir):
6161
"""
6262
This fixture allows one to mock (fake) running CP2K.
@@ -169,7 +169,7 @@ def fake_run_cp2k(
169169
logger.info("Generated fake cp2k outputs")
170170

171171

172-
@pytest.fixture()
172+
@pytest.fixture
173173
def check_input():
174174
def _check_input(ref_path, user_input):
175175
from pymatgen.io.cp2k.inputs import Cp2kInput

tests/vasp/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def lobster_test_dir(test_dir):
3838
return test_dir / "lobster"
3939

4040

41-
@pytest.fixture()
41+
@pytest.fixture
4242
def mock_vasp(
4343
monkeypatch: MonkeyPatch, vasp_test_dir: Path
4444
) -> Generator[Callable[[Any, Any], Any], None, None]:

0 commit comments

Comments
 (0)