Skip to content

Commit

Permalink
feat: introduce ruff and pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee-W committed Jun 17, 2023
1 parent 3409f98 commit d9062c8
Show file tree
Hide file tree
Showing 14 changed files with 944 additions and 1,284 deletions.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,3 @@ body:
label: Screenshots
description: |
If applicable, add screenshots to help explain your problem.
52 changes: 45 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,58 @@
default_stages: [push]
default_install_hook_types:
- pre-commit
- commit-msg
- pre-push

default_stages:
- commit
- push

repos:
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.4.0
hooks:
- id: check-vcs-permalinks
- id: end-of-file-fixer
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: check-case-conflict
- id: check-merge-conflict
- id: debug-statements
exclude: "{{cookiecutter.project_slug}}"
- id: no-commit-to-branch
- id: check-merge-conflict
- id: check-toml
exclude: "{{cookiecutter.project_slug}}"
- id: check-yaml
exclude: "{{cookiecutter.project_slug}}"
- id: detect-private-key

- repo: https://github.com/asottile/blacken-docs
rev: 1.13.0
hooks:
- id: blacken-docs
additional_dependencies: [black>=22.10]

- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
name: Run codespell to check for common misspellings in files
language: python
types: [text]
args: ["--write-changes", "--ignore-words-list", "asend"]

- repo: https://github.com/Woile/commitizen
rev: v2.17.13
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.2.2
hooks:
- id: commitizen
stages: [commit-msg]
- id: commitizen-branch
stages:
- post-commit
- push

- repo: local
hooks:
Expand Down
2 changes: 1 addition & 1 deletion cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"github_url": "https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}",
"author_name": "Wei Lee",
"author_email": "weilee.rx@gmail.com",
"python_version": "3.7",
"python_version": "3.8",
"dependency_management_tool": [
"poetry",
"pipenv"
Expand Down
3 changes: 1 addition & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@

* [pipenv](https://pipenv.pypa.io/en/latest/) or [poetry](https://python-poetry.org/): dependency and virtual environment management
* Coding style
* [flake8](https://flake8.pycqa.org/en/latest/) and [pylint](https://pylint.org/) (optional): check style, programming errors and complexity
* [ruff](https://github.com/astral-sh/ruff): check style
* [mypy](http://mypy-lang.org/): check static type
* [black](https://github.com/psf/black): auto format your code
* [isort](https://pycqa.github.io/isort/): auto sort your package importing
* Test thought [pytest](https://docs.pytest.org/en/) with the following supports
* [pytest-cov](https://github.com/pytest-dev/pytest-cov): generate test coverage repo
* [pytest-mock](https://github.com/pytest-dev/pytest-mock/): mocking
Expand Down
Loading

0 comments on commit d9062c8

Please sign in to comment.