Skip to content

Commit f515db0

Browse files
authored
Merge pull request #59 from Materials-Data-Science-and-Informatics/58-use-ruff
58 use ruff
2 parents 458f2f7 + d91de86 commit f515db0

15 files changed

Lines changed: 261 additions & 193 deletions

File tree

.pre-commit-config.yaml

Lines changed: 64 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,68 @@
11
repos:
2-
# Various general + format-specific helpers
3-
- repo: https://github.com/pre-commit/pre-commit-hooks
4-
rev: v4.4.0
5-
hooks:
6-
- id: check-symlinks
7-
- id: trailing-whitespace
8-
- id: mixed-line-ending
9-
args: [--fix=lf]
10-
- id: check-yaml
11-
exclude: 'mkdocs.yml'
12-
- id: check-toml
13-
- id: check-json
14-
- id: check-ast
15-
- id: debug-statements
16-
- id: check-merge-conflict
17-
- id: check-shebang-scripts-are-executable
18-
- id: check-added-large-files
19-
args: [--maxkb=10000]
20-
- repo: https://github.com/python-jsonschema/check-jsonschema
21-
rev: '0.22.0'
22-
hooks:
23-
- id: check-github-workflows
24-
- repo: https://github.com/pycqa/isort
25-
rev: '5.12.0'
26-
hooks:
27-
- id: isort
28-
args: ['--profile', 'black']
29-
- repo: https://github.com/ambv/black
30-
rev: '23.1.0'
31-
hooks:
32-
- id: black
33-
- repo: https://github.com/PyCQA/autoflake
34-
rev: v2.1.1
35-
hooks:
36-
- id: autoflake
2+
# Various general + format-specific helpers
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.4.0
5+
hooks:
6+
- id: check-symlinks
7+
- id: trailing-whitespace
8+
- id: mixed-line-ending
9+
args: [--fix=lf]
10+
- id: check-yaml
11+
exclude: "mkdocs.yml"
12+
- id: check-toml
13+
- id: check-json
14+
- id: check-ast
15+
- id: debug-statements
16+
- id: check-merge-conflict
17+
- id: check-shebang-scripts-are-executable
18+
- id: check-added-large-files
19+
args: [--maxkb=10000]
20+
- repo: https://github.com/python-jsonschema/check-jsonschema
21+
rev: "0.22.0"
22+
hooks:
23+
- id: check-github-workflows
24+
- repo: https://github.com/astral-sh/ruff-pre-commit
25+
# Ruff version.
26+
rev: v0.1.6
27+
hooks:
28+
# Run the linter.
29+
- id: ruff
30+
types_or: [python, pyi, jupyter]
31+
args: [--fix]
32+
# Run the formatter.
33+
- id: ruff-format
34+
types_or: [python, pyi, jupyter]
35+
- repo: https://github.com/pre-commit/mirrors-mypy
36+
rev: "v1.1.1"
37+
hooks:
38+
- id: mypy
39+
args: [--no-strict-optional, --ignore-missing-imports]
40+
# NOTE: you might need to add some deps here:
41+
additional_dependencies: []
3742

38-
# Quality
39-
- repo: https://github.com/pycqa/flake8
40-
rev: '6.0.0'
41-
hooks:
42-
- id: flake8
43-
additional_dependencies:
44-
- Flake8-pyproject==1.2.3
45-
- flake8-bugbear==23.3.23
46-
- dlint==0.14.1
47-
- repo: https://github.com/pycqa/pydocstyle
48-
rev: '6.3.0'
49-
hooks:
50-
- id: pydocstyle
51-
additional_dependencies: ['tomli==2.0.1']
52-
files: '^src/'
53-
- repo: https://github.com/pre-commit/mirrors-mypy
54-
rev: 'v1.1.1'
55-
hooks:
56-
- id: mypy
57-
args: [--no-strict-optional, --ignore-missing-imports]
58-
# NOTE: you might need to add some deps here:
59-
additional_dependencies: []
60-
- repo: https://github.com/PyCQA/bandit
61-
rev: '1.7.5'
62-
hooks:
63-
- id: bandit
64-
args: ['-q', '-c', 'pyproject.toml']
65-
additional_dependencies: ['.[toml]']
43+
# Metadata
44+
- repo: https://github.com/citation-file-format/cff-converter-python
45+
rev: "44e8fc9"
46+
hooks:
47+
- id: validate-cff
48+
- repo: https://github.com/fsfe/reuse-tool
49+
rev: "v1.1.2"
50+
hooks:
51+
- id: reuse
6652

67-
# Metadata
68-
- repo: https://github.com/citation-file-format/cff-converter-python
69-
rev: '44e8fc9'
70-
hooks:
71-
- id: validate-cff
72-
- repo: https://github.com/fsfe/reuse-tool
73-
rev: 'v1.1.2'
74-
hooks:
75-
- id: reuse
53+
- repo: local
54+
hooks:
55+
# NOTE: copy from .pre-commit-hooks.yaml, for technical reasons
56+
- id: somesy-sync
57+
name: Run somesy sync
58+
entry: somesy sync
59+
language: python
60+
files: '^\.somesy\.toml|pyproject\.toml$'
61+
pass_filenames: false
7662

77-
- repo: local
78-
hooks:
79-
# NOTE: copy from .pre-commit-hooks.yaml, for technical reasons
80-
- id: somesy-sync
81-
name: Run somesy sync
82-
entry: somesy sync
83-
language: python
84-
files: '^\.somesy\.toml|pyproject\.toml$'
85-
pass_filenames: false
86-
87-
- id: somesy-fill
88-
name: Update AUTHORS.md
89-
entry: somesy fill -t docs/_template_authors.md -o AUTHORS.md
90-
language: python
91-
files: '^\.somesy\.toml|pyproject\.toml$'
92-
pass_filenames: false
63+
- id: somesy-fill
64+
name: Update AUTHORS.md
65+
entry: somesy fill -t docs/_template_authors.md -o AUTHORS.md
66+
language: python
67+
files: '^\.somesy\.toml|pyproject\.toml$'
68+
pass_filenames: false

.somesy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@ codemeta_file = "codemeta.json"
7676
no_sync_package_json = true
7777
show_info = false
7878
verbose = false
79-
debug = false
79+
debug = true

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ Here we provide notes that summarize the most important changes in each released
44

55
Please consult the changelog to inform yourself about breaking changes and security issues.
66

7+
## [v0.2.1](https://github.com/Materials-Data-Science-and-Informatics/somesy/tree/v0.2.1) <small>(2023-11-29)</small> { id="0.2.1" }
8+
9+
* **internal:** updated linters and dependencies
10+
* **internal:** pin codemetapy version to 2.5.2 to avoid breaking changes
11+
* fix bug caused by missing `config` section
12+
713
## [v0.2.0](https://github.com/Materials-Data-Science-and-Informatics/somesy/tree/v0.2.0) <small>(2023-11-29)</small> { id="0.2.0" }
814

9-
* Test refactoring
10-
* Pydantic 2 implementation
15+
* **internal:** Test refactoring
16+
* **internal:** Pydantic 2 implementation
1117
* Added `publication_author` field to Person model
1218

1319
## [v0.1.0](https://github.com/Materials-Data-Science-and-Informatics/somesy/tree/v0.1.0) <small>(2023-08-10)</small> { id="0.1.0" }

codemeta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"identifier": "codemetapy",
7676
"name": "codemetapy",
7777
"runtimePlatform": "Python 3",
78-
"version": "^2.5.1"
78+
"version": "2.5.2"
7979
},
8080
{
8181
"@type": "SoftwareApplication",

0 commit comments

Comments
 (0)