Skip to content

Commit

Permalink
Ruff linter + pre-commit integration (#140)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
juanitorduz authored Jan 26, 2024
1 parent 7fb9c39 commit d0f3e9a
Show file tree
Hide file tree
Showing 20 changed files with 193 additions and 587 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ assignees: ''

## Tell us about it

The more specific the better.
The more specific the better.

## Thoughts on implementation

Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,6 @@ jobs:
python --version
conda list
pip freeze
- name: Run linters
shell: bash -l {0}
run: |
python -m black pymc_bart --check
echo "Success!"
echo "Checking code style with pylint..."
python -m pylint pymc_bart/
- name: Run Mypy
shell: bash -l {0}
run: |
python -m mypy pymc_bart
- name: Run tests
shell: bash -l {0}
run: |
Expand Down
40 changes: 23 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_branch: ""
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
autoupdate_schedule: weekly
skip: []
submodules: false

repos:
- repo: local
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.14
hooks:
- id: ruff
args: ["--fix", "--show-source"]
- id: ruff-format
args: ["--line-length=100"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: black
name: black
entry: black
language: system
types: [python]
files: ^pymc_bart/
- id: pylint
name: pylint
entry: pylint --rcfile=.pylintrc
language: system
types: [python]
files: ^pymc_bart/
- id: mypy
name: mypy
entry: mypy
language: system
types: [python]
args: [--ignore-missing-imports]
files: ^pymc_bart/
additional_dependencies: [numpy<1.25.0, pandas-stubs]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
Expand Down
Loading

0 comments on commit d0f3e9a

Please sign in to comment.