From 5688124b21d767f15c0162cdcfb8bc041962ecb1 Mon Sep 17 00:00:00 2001 From: Lev Vereshchagin Date: Sun, 5 Dec 2021 18:33:05 +0300 Subject: [PATCH] Add pre-commit, prettier configs and editorconfig --- .editorconfig | 19 ++++++++++++++++++ .pre-commit-config.yaml | 44 +++++++++++++++++++++++++++++++++++++++++ .prettierignore | 1 + 3 files changed, 64 insertions(+) create mode 100644 .editorconfig create mode 100644 .pre-commit-config.yaml create mode 100644 .prettierignore diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..4f050ea6 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +# http://editorconfig.org +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.{py, pyi}] +indent_size = 4 + +[*Dockerfile*] +indent_size = 4 + +[*.md] +trim_trailing_whitespace = false diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..3437ad4d --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,44 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.0.1 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-toml + + - repo: https://github.com/asottile/pyupgrade + rev: v2.29.1 + hooks: + - id: pyupgrade + args: [--py37-plus] + + - repo: https://github.com/psf/black + rev: 21.11b1 + hooks: + - id: black + + - repo: https://github.com/pycqa/isort + rev: 5.10.1 + hooks: + - id: isort + + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v2.5.0 + hooks: + - id: prettier + exclude: installation/docker-compose-custom.yml + + - repo: https://github.com/codespell-project/codespell + rev: v2.1.0 + hooks: + - id: codespell + + - repo: https://github.com/scop/pre-commit-shfmt + rev: v3.4.1-1 + hooks: + - id: shfmt # native (requires Go to build) + + - repo: https://github.com/shellcheck-py/shellcheck-py + rev: v0.8.0.1 + hooks: + - id: shellcheck diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..abe1f008 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +installation/docker-compose-custom.yml