Skip to content

Commit

Permalink
Merge pull request #395 from materialsproject/mypy-no-implicit-optional
Browse files Browse the repository at this point in the history
`ruff` select `perflint` `flake8-slots`
  • Loading branch information
utf committed Jun 26, 2023
2 parents 21fd169 + 4f7231d commit 896604a
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 38 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_language_version:
exclude: '^src/atomate2/vasp/schemas/calc_types/|^.github/'
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.272
rev: v0.0.275
hooks:
- id: ruff
args: [--fix]
Expand Down
64 changes: 33 additions & 31 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,39 +141,41 @@ exclude_lines = [
[tool.ruff]
target-version = "py38"
select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"D", # pydocstyle
"E", # pycodestyle error
"EXE", # flake8-executable
"F", # pyflakes
"FLY", # flynt
"I", # isort
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"PD", # pandas-vet
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PYI", # flakes8-pyi
"Q", # flake8-quotes
"RET", # flake8-return
"RSE", # flake8-raise
"RUF", # Ruff-specific rules
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"TID", # tidy imports
"TID", # flake8-tidy-imports
"UP", # pyupgrade
"W", # pycodestyle warning
"YTT", # flake8-2020
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"D", # pydocstyle
"E", # pycodestyle error
"EXE", # flake8-executable
"F", # pyflakes
"FLY", # flynt
"I", # isort
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"PD", # pandas-vet
"PERF", # perflint
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PYI", # flakes8-pyi
"Q", # flake8-quotes
"RET", # flake8-return
"RSE", # flake8-raise
"RUF", # Ruff-specific rules
"SIM", # flake8-simplify
"SLOT", # flake8-slots
"TCH", # flake8-type-checking
"TID", # tidy imports
"TID", # flake8-tidy-imports
"UP", # pyupgrade
"W", # pycodestyle warning
"YTT", # flake8-2020
]
ignore = [
"PD011", # pandas-use-of-dot-values
"PLC1901", # compare-to-empty-string
"PLR", # pylint-refactor
"PT004", # pytest-missing-fixture-name-underscore
"PT006", # pytest-parametrize-names-wrong-type
"PD011", # pandas-use-of-dot-values
"PLR", # pylint-refactor
"PT004", # pytest-missing-fixture-name-underscore
"PT006", # pytest-parametrize-names-wrong-type
"RUF013", # implicit-optional
# TODO remove PT011, pytest.raises() should always check err msg
"PT011", # pytest-raises-too-broad
"PT013", # pytest-incorrect-pytest-import
Expand Down
3 changes: 1 addition & 2 deletions src/atomate2/common/schemas/cclib.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,7 @@ def from_logfile(
metadata=metadata,
)
doc.molecule = final_molecule
doc = doc.copy(update=additional_fields)
return doc
return doc.copy(update=additional_fields)


@requires(cclib, "cclib_calculate requires cclib to be installed.")
Expand Down
3 changes: 1 addition & 2 deletions src/atomate2/cp2k/schemas/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,7 @@ def from_directory(
}
doc = cls(**ddict)
doc = doc.copy(update=data)
doc = doc.copy(update=additional_fields)
return doc
return doc.copy(update=additional_fields)

@staticmethod
def get_entry(
Expand Down
3 changes: 1 addition & 2 deletions src/atomate2/lobster/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,7 @@ def from_directory(
charges=charges,
madelung_energies=madelung_energies,
)
doc = doc.copy(update=additional_fields)
return doc
return doc.copy(update=additional_fields)


def _identify_strongest_bonds(
Expand Down

0 comments on commit 896604a

Please sign in to comment.