Skip to content

Commit ea952e1

Browse files
dalitovladistan
authored andcommitted
Add pre-commit & editor config as in linkml
1 parent f37216e commit ea952e1

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

.editorconfig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Check http://editorconfig.org for more information
2+
# This is the main config file for this project:
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
insert_final_newline = true
9+
indent_style = space
10+
indent_size = 2
11+
trim_trailing_whitespace = true
12+
13+
[*.py]
14+
indent_style = space
15+
indent_size = 4
16+
17+
[*.py.jinja]
18+
indent_style = space
19+
indent_size = 4
20+
21+
[*.md]
22+
trim_trailing_whitespace = false

.pre-commit-config.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
default_language_version:
2+
python: python3
3+
# Specify files to exclude - pre-commit hook doesn't parse pyproject.toml
4+
exclude: tests/data/hp.ttl|tests/data/hp_f.ttl|.*\.svg|jsonschema_value_constraints.yaml
5+
repos:
6+
- repo: https://github.com/pre-commit/pre-commit-hooks
7+
rev: v4.4.0
8+
hooks:
9+
- id: end-of-file-fixer
10+
exclude: __snapshots__
11+
- id: check-yaml
12+
exclude: (__snapshots__|test_utils/input)
13+
- id: check-toml
14+
- id: trailing-whitespace
15+
# TODO: This is temporary while bioliank is being fixed upstream.
16+
# TODO: Should look at snapshot exclusion to find upstream problems
17+
exclude: (__snapshots__|biolink-model.yaml)
18+
- repo: https://github.com/astral-sh/ruff-pre-commit
19+
# Ensure this version stays in sync with tox.ini
20+
rev: v0.11.13
21+
hooks:
22+
# Run the linter.
23+
- id: ruff-check
24+
args: [--fix, --exit-non-zero-on-fix]
25+
# Run the formatter.
26+
- id: ruff-format
27+
- repo: https://github.com/codespell-project/codespell
28+
rev: v2.4.1
29+
hooks:
30+
- id: codespell
31+
additional_dependencies:
32+
- tomli

0 commit comments

Comments
 (0)