Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: introduce pre-commit #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-executables-have-shebangs
# check toml files
- id: check-toml
# check yaml files
- id: check-yaml
# fixing empty or blank of end file
- id: end-of-file-fixer
types: [python]
# check trailing whitespace on file
- id: trailing-whitespace
# sort the entries of package on requirements.txt
- id: requirements-txt-fixer

# ruff formatter and linter
# replace black and flake8
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.3
hooks:
- id: ruff
- id: ruff-format

# mirror of prettier
# beautify of toml and yaml files
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v4.0.0-alpha.8"
hooks:
- id: prettier
types_or: [toml, yaml]
10 changes: 10 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
line-length = 88

# ignore specific error from lint with ruff
[lint]
ignore = ["F541", "F841", "E711", "E721", "F541", "E741", "F401", "F403", "E712", "E731", "F811"]


[format]
# according PEP8 python, double quotes for strings.
quote-style = "double"