Explorar o código

pre-commit: initialize with black & isort

Sumner Evans %!s(int64=3) %!d(string=hai) anos
pai
achega
7c1400804f
Modificáronse 2 ficheiros con 24 adicións e 1 borrados
  1. 1 1
      .editorconfig
  2. 23 0
      .pre-commit-config.yaml

+ 1 - 1
.editorconfig

@@ -17,5 +17,5 @@ trim_trailing_whitespace = false
 [*.{yaml,yml,py,md}]
 indent_style = space
 
-[{.gitlab-ci.yml,*.md,.github/workflows/*.yml}]
+[{.gitlab-ci.yml,*.md,.github/workflows/*.yml,.pre-commit-config.yaml}]
 indent_size = 2

+ 23 - 0
.pre-commit-config.yaml

@@ -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: ^(mausignald|mautrix_signal)/.*\.py$
+  - repo: https://github.com/PyCQA/isort
+    rev: 5.10.1
+    hooks:
+      - id: isort
+        files: ^(mausignald|mautrix_signal)/.*$