From f664d4ad904db36cbced56d37b9293e7adb4a2c4 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Fri, 21 Jan 2022 00:02:42 -0700 Subject: [PATCH] pre-commit: add configuration --- .editorconfig | 2 +- .pre-commit-config.yaml | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .pre-commit-config.yaml diff --git a/.editorconfig b/.editorconfig index 96c9834e..10c7c30f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..0149638a --- /dev/null +++ b/.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: ^mautrix_telegram/.*\.py$ + - repo: https://github.com/PyCQA/isort + rev: 5.10.1 + hooks: + - id: isort + files: ^mautrix_telegram/.*$