Skip to content

Commit 1ebc9a7

Browse files
committed
bump ruff + auto-fixes
1 parent 54a9645 commit 1ebc9a7

File tree

11 files changed

+44
-49
lines changed

11 files changed

+44
-49
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ default_language_version:
33
exclude: ^(.github/|tests/test_data/abinit/)
44
repos:
55
- repo: https://github.com/charliermarsh/ruff-pre-commit
6-
rev: v0.5.6
6+
rev: v0.6.1
77
hooks:
88
- id: ruff
99
args: [--fix]

pyproject.toml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,10 @@ target-version = "py39"
165165
[tool.ruff.lint]
166166
select = ["ALL"]
167167
ignore = [
168-
"ANN002",
169-
"ANN003",
170-
"ANN101", # missing self type annotation
171-
"ANN102", # missing cls annotation
172-
"ANN401",
173-
"ARG002", # unused method argument
174-
# "BLE001",
168+
"ANN002", # Missing type annotation for *arg
169+
"ANN003", # Missing type annotation for **kwargs
170+
"ANN401", # typing.Any disallowed
171+
"ARG002", # unused method argument
175172
"C408", # Unnecessary (dict/list/tuple) call - remove call
176173
"C901", # function too complex
177174
"COM812", # trailing comma missing
@@ -180,7 +177,7 @@ ignore = [
180177
"FBT001",
181178
"FBT002",
182179
"FIX002",
183-
"G004", # logging uses fstring
180+
"G004", # logging uses f-string
184181
"ISC001",
185182
"PD011", # pandas-use-of-dot-values
186183
"PERF203", # try-except-in-loop

tests/abinit/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def abinit_integration_tests(pytestconfig):
2727
return pytestconfig.getoption("abinit_integration")
2828

2929

30-
@pytest.fixture()
30+
@pytest.fixture
3131
def mock_abinit(mocker, abinit_test_dir, abinit_integration_tests):
3232
"""
3333
This fixture allows one to mock running ABINIT.

tests/aims/conftest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def pytest_addoption(parser):
3434
)
3535

3636

37-
@pytest.fixture()
37+
@pytest.fixture
3838
def si():
3939
return Structure(
4040
lattice=Lattice(
@@ -45,7 +45,7 @@ def si():
4545
)
4646

4747

48-
@pytest.fixture()
48+
@pytest.fixture
4949
def o2():
5050
return Molecule(species=["O", "O"], coords=[[0, 0, 0.622978], [0, 0, -0.622978]])
5151

@@ -64,15 +64,15 @@ def ref_path():
6464
return test_dir.resolve()
6565

6666

67-
@pytest.fixture()
67+
@pytest.fixture
6868
def should_mock_aims(request):
6969
try:
7070
return not request.config.getoption("--generate-test-data")
7171
except ValueError:
7272
return True
7373

7474

75-
@pytest.fixture()
75+
@pytest.fixture
7676
def mock_aims(monkeypatch, ref_path, should_mock_aims):
7777
"""
7878
This fixture allows one to mock (fake) running FHI-aims.

tests/aims/test_files/test_files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
TEST_DIR = Path(__file__).parent
88

99

10-
@pytest.fixture()
10+
@pytest.fixture
1111
def tmp_dir():
1212
"""Same as clean_dir but is fresh for every test"""
1313
import os

tests/conftest.py

Lines changed: 7 additions & 7 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,27 +92,27 @@ 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

9999

100-
@pytest.fixture()
100+
@pytest.fixture
101101
def si_diamond(test_dir):
102102
return Structure.from_file(test_dir / "structures" / "Si_diamond.cif")
103103

104104

105-
@pytest.fixture()
105+
@pytest.fixture
106106
def al2_au_structure(test_dir):
107107
return Structure.from_file(test_dir / "structures" / "Al2Au.cif")
108108

109109

110-
@pytest.fixture()
110+
@pytest.fixture
111111
def sr_ti_o3_structure(test_dir):
112112
return Structure.from_file(test_dir / "structures" / "SrTiO3.cif")
113113

114114

115-
@pytest.fixture()
115+
@pytest.fixture
116116
def ba_ti_o3_structure(test_dir):
117117
return Structure.from_file(test_dir / "structures" / "BaTiO3.cif")
118118

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
from pymatgen.io.cp2k.inputs import Cp2kInput
175175

tests/qchem/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def qchem_test_dir(test_dir):
3131
return test_dir / "qchem"
3232

3333

34-
@pytest.fixture()
34+
@pytest.fixture
3535
def mock_qchem(
3636
monkeypatch: MonkeyPatch, qchem_test_dir: Path
3737
) -> Generator[Callable[[Any, Any], Any], None, None]:

tests/vasp/conftest.py

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

4646

47-
@pytest.fixture()
47+
@pytest.fixture
4848
def mock_vasp(
4949
monkeypatch: MonkeyPatch, vasp_test_dir: Path
5050
) -> Generator[Callable[[Any, Any], Any], None, None]:

tests/vasp/lobster/conftest.py

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

2929

30-
@pytest.fixture()
30+
@pytest.fixture
3131
def mock_lobster(monkeypatch, lobster_test_dir):
3232
"""
3333
This fixture allows one to mock (fake) running LOBSTER.

0 commit comments

Comments
 (0)