Skip to content

Commit

Permalink
Use ruff instead of black, isort, pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Mar 18, 2024
1 parent 64da4bf commit 5644be4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 26 deletions.
23 changes: 6 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,10 @@ repos:
- id: trailing-whitespace
- id: check-json

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.2.2
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]

- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black

- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
types: [python]
language: system
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
- id: ruff-format
2 changes: 0 additions & 2 deletions .pylintrc

This file was deleted.

4 changes: 1 addition & 3 deletions aiida_registry/fetch_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,7 @@ def get_git_commits_count(repo_name):
return int(commits_count)


def complete_plugin_data(
plugin_data: dict, fetch_pypi=True, fetch_pypi_wheel=True
): # pylint: disable=too-many-branches,too-many-statements
def complete_plugin_data(plugin_data: dict, fetch_pypi=True, fetch_pypi_wheel=True): # pylint: disable=too-many-branches,too-many-statements
"""Update plugin data dictionary.
* add metadata, aiida_version and entrypoints from plugin_info
Expand Down
6 changes: 3 additions & 3 deletions aiida_registry/parse_build_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,9 @@ def parse_setup_cfg(content: str, ep_only=False) -> SourceData:
}
if config.has_option("metadata", "classifiers"):
infos["metadata"]["classifiers"] = [
l.strip()
for l in config.get("metadata", "classifiers").splitlines()
if l.strip() and not l.strip().startswith("#")
line.strip()
for line in config.get("metadata", "classifiers").splitlines()
if line.strip() and not line.strip().startswith("#")
]

return SourceData(**infos)
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ dependencies = [
"markupsafe~=2.0.1",
# dev dependencies
"pre-commit~=2.2",
"pylint~=2.16.1",
"pytest~=6.2.2",
"pytest-regressions~=2.5.0",
]
Expand Down

0 comments on commit 5644be4

Please sign in to comment.