Merge pull request #745 from mautrix/pre-commit-config
pre-commit: add configuration
This commit is contained in:
+1
-1
@@ -17,5 +17,5 @@ max_line_length = 99
|
||||
[*.{yaml,yml,py}]
|
||||
indent_style = space
|
||||
|
||||
[.gitlab-ci.yml]
|
||||
[{.gitlab-ci.yml,.pre-commit-config.yaml}]
|
||||
indent_size = 2
|
||||
|
||||
@@ -16,3 +16,10 @@ jobs:
|
||||
- uses: psf/black@21.12b0
|
||||
with:
|
||||
src: "./mautrix_telegram"
|
||||
- name: pre-commit
|
||||
run: |
|
||||
pip install pre-commit
|
||||
pre-commit run -av trailing-whitespace
|
||||
pre-commit run -av end-of-file-fixer
|
||||
pre-commit run -av check-yaml
|
||||
pre-commit run -av check-added-large-files
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.1.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
exclude_types: [markdown]
|
||||
- id: end-of-file-fixer
|
||||
- id: check-yaml
|
||||
- id: check-added-large-files
|
||||
# TODO convert to use the upstream psf/black when
|
||||
# https://github.com/psf/black/issues/2493 gets fixed
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: black
|
||||
name: black
|
||||
entry: black --check
|
||||
language: system
|
||||
files: ^mautrix_telegram/.*\.py$
|
||||
- repo: https://github.com/PyCQA/isort
|
||||
rev: 5.10.1
|
||||
hooks:
|
||||
- id: isort
|
||||
files: ^mautrix_telegram/.*$
|
||||
@@ -0,0 +1,3 @@
|
||||
pre-commit>=2.10.1,<3
|
||||
isort>=5.10.1,<6
|
||||
black==21.12b2
|
||||
Reference in New Issue
Block a user