update: add support for pre-commit #232

Merged
synchon merged 10 commits from enh/pre-commit into main 2023-06-21 10:48:42 +00:00
49 changed files with 195 additions and 145 deletions

48
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,48 @@
ci:
autofix_prs: false
autoupdate_commit_msg: "chore: bump pre-commit repositories"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-ast
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-yaml
- id: check-toml
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.12.2
hooks:
- id: validate-pyproject
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
exclude: ^(docs/|examples/|tools/)
args: [--check]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.267
hooks:
- id: ruff
exclude: ^(__init__.py)
args: [--format, grouped, --show-fixes]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
exclude: ^(.github/|docs/)
args: [--config, tox.ini]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-no-eval
- id: python-no-log-warn
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal

View file

@ -10,6 +10,7 @@
![Codecov](https://img.shields.io/codecov/c/github/juaml/junifer?style=flat-square) ![Codecov](https://img.shields.io/codecov/c/github/juaml/junifer?style=flat-square)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/charliermarsh/ruff) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/charliermarsh/ruff)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
## About ## About

View file

@ -0,0 +1 @@
Adopt ``pre-commmit`` for adding and managing git pre-commit hooks by `Synchon Mandal`_

Some files were not shown because too many files have changed in this diff Show more