Skip to content

Commit 960f506

Browse files
author
Shyue Ping Ong
committed
Fix ruff. Add pre-commit.
1 parent ad246e4 commit 960f506

File tree

4 files changed

+50
-12
lines changed

4 files changed

+50
-12
lines changed

.pre-commit-config.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
exclude: ^(docs|.*test_files|cmd_line|tasks.py)
2+
3+
ci:
4+
autoupdate_schedule: monthly
5+
skip: [mypy]
6+
autofix_commit_msg: pre-commit auto-fixes
7+
autoupdate_commit_msg: pre-commit autoupdate
8+
9+
repos:
10+
- repo: https://github.com/astral-sh/ruff-pre-commit
11+
rev: v0.0.278
12+
hooks:
13+
- id: ruff
14+
args: [--fix]
15+
16+
- repo: https://github.com/pre-commit/pre-commit-hooks
17+
rev: v4.4.0
18+
hooks:
19+
- id: check-yaml
20+
exclude: pymatgen/analysis/vesta_cutoffs.yaml
21+
- id: end-of-file-fixer
22+
- id: trailing-whitespace
23+
24+
- repo: https://github.com/psf/black
25+
rev: 23.7.0
26+
hooks:
27+
- id: black
28+
29+
- repo: https://github.com/pre-commit/mirrors-mypy
30+
rev: v1.4.1
31+
hooks:
32+
- id: mypy
33+
34+
- repo: https://github.com/codespell-project/codespell
35+
rev: v2.2.5
36+
hooks:
37+
- id: codespell
38+
stages: [commit, commit-msg]
39+
exclude_types: [html]
40+
additional_dependencies: [tomli] # needed to read pyproject.toml below py3.11
41+
42+
- repo: https://github.com/MarcoGorelli/cython-lint
43+
rev: v0.15.0
44+
hooks:
45+
- id: cython-lint
46+
args: [--no-pycodestyle]
47+
- id: double-quote-cython-strings

package/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
"""
2-
Root init file.
3-
"""
1+
"""Root init file."""

setup.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@
22

33
from __future__ import annotations
44

5-
import platform
6-
import sys
7-
8-
import numpy as np
9-
from setuptools import Extension, find_namespace_packages, setup
10-
5+
from setuptools import find_namespace_packages, setup
116

127
with open("README.md") as file:
138
long_description = file.read()

tests/conftest.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
"""
2-
Test fixtures for unittests.
3-
"""
1+
"""Test fixtures for unittests."""

0 commit comments

Comments
 (0)