Skip to content

Commit d0f3e9a

Browse files
authored
Ruff linter + pre-commit integration (#140)
* add ruff support * add pre-commit-ci for automated updated on the revisions (versions) of the packages * remove code check from workflow * undo myst config change * add pylint * add pylint fixes * add contributing guidelines
1 parent 7fb9c39 commit d0f3e9a

20 files changed

+193
-587
lines changed

Diff for: .github/ISSUE_TEMPLATE/feature_request.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ assignees: ''
99

1010
## Tell us about it
1111

12-
The more specific the better.
12+
The more specific the better.
1313

1414
## Thoughts on implementation
1515

Diff for: .github/workflows/test.yml

-11
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,6 @@ jobs:
3636
python --version
3737
conda list
3838
pip freeze
39-
- name: Run linters
40-
shell: bash -l {0}
41-
run: |
42-
python -m black pymc_bart --check
43-
echo "Success!"
44-
echo "Checking code style with pylint..."
45-
python -m pylint pymc_bart/
46-
- name: Run Mypy
47-
shell: bash -l {0}
48-
run: |
49-
python -m mypy pymc_bart
5039
- name: Run tests
5140
shell: bash -l {0}
5241
run: |

Diff for: .pre-commit-config.yaml

+23-17
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
1+
ci:
2+
autofix_commit_msg: |
3+
[pre-commit.ci] auto fixes from pre-commit.com hooks
4+
5+
for more information, see https://pre-commit.ci
6+
autofix_prs: true
7+
autoupdate_branch: ""
8+
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
9+
autoupdate_schedule: weekly
10+
skip: []
11+
submodules: false
12+
113
repos:
2-
- repo: local
14+
- repo: https://github.com/astral-sh/ruff-pre-commit
15+
rev: v0.1.14
16+
hooks:
17+
- id: ruff
18+
args: ["--fix", "--show-source"]
19+
- id: ruff-format
20+
args: ["--line-length=100"]
21+
- repo: https://github.com/pre-commit/mirrors-mypy
22+
rev: v1.8.0
323
hooks:
4-
- id: black
5-
name: black
6-
entry: black
7-
language: system
8-
types: [python]
9-
files: ^pymc_bart/
10-
- id: pylint
11-
name: pylint
12-
entry: pylint --rcfile=.pylintrc
13-
language: system
14-
types: [python]
15-
files: ^pymc_bart/
1624
- id: mypy
17-
name: mypy
18-
entry: mypy
19-
language: system
20-
types: [python]
25+
args: [--ignore-missing-imports]
2126
files: ^pymc_bart/
27+
additional_dependencies: [numpy<1.25.0, pandas-stubs]
2228
- repo: https://github.com/pre-commit/pre-commit-hooks
2329
rev: v3.2.0
2430
hooks:

0 commit comments

Comments
 (0)