Skip to content

Commit 134ac6a

Browse files
authored
Auto-update pre-commit hooks
1 parent 3b4c511 commit 134ac6a

File tree

13 files changed

+34
-30
lines changed

13 files changed

+34
-30
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 6 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.11.12
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: v5.0.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.19.1
2020
hooks:
2121
- id: blacken-docs
2222
additional_dependencies: [black]
@@ -29,17 +29,17 @@ 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.16.0
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.4.1
4141
hooks:
4242
- id: codespell
43-
stages: [commit, commit-msg]
43+
stages: [pre-commit, commit-msg]
4444
args: [--ignore-words-list, 'titel,statics,ba,nd,te,atomate']
4545
types_or: [python, rst, markdown]

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/cclib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class TaskDocument(MoleculeMetadata, extra="allow"): # type: ignore[call-arg]
6767
@classmethod
6868
@requires(cclib, "The cclib TaskDocument requires cclib to be installed.")
6969
def from_logfile(
70-
cls: type[_T],
70+
cls,
7171
dir_name: Union[str, Path],
7272
logfile_extensions: Union[str, list[str]],
7373
store_trajectory: bool = False,

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: 2 additions & 1 deletion
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
@@ -305,7 +306,7 @@ class TaskDocument(StructureMetadata, MoleculeMetadata):
305306

306307
@classmethod
307308
def from_directory(
308-
cls: type[_T],
309+
cls,
309310
dir_name: Union[Path, str],
310311
volumetric_files: tuple[str, ...] = _VOLUMETRIC_FILES,
311312
store_additional_json: bool = SETTINGS.CP2K_STORE_ADDITIONAL_JSON,

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/flows/phonons.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,12 @@ def make(
203203
"structure"
204204
)
205205

206-
if (
207-
self.kpath_scheme
208-
not in "seekpath hinuma setyawan_curtarolo latimer_munro".split()
209-
):
206+
if self.kpath_scheme not in [
207+
"seekpath",
208+
"hinuma",
209+
"setyawan_curtarolo",
210+
"latimer_munro",
211+
]:
210212
raise ValueError("kpath scheme is not implemented")
211213

212214
jobs = []

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

0 commit comments

Comments
 (0)