From 63da9a2beb2553a18517184940f85f566eaa0e48 Mon Sep 17 00:00:00 2001 From: Jamil Bou Kheir Date: Mon, 4 May 2020 23:53:58 -0700 Subject: [PATCH] Add elixir to pre-commit --- .pre-commit-config.yaml | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 859ac3df3..428bf71ea 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,33 @@ repos: -- repo: https://github.com/pre-commit/pre-commit-hooks + # Elixir config + - repo: local + hooks: + - id: mix-format + name: 'elixir: mix format' + entry: mix format --check-formatted + language: system + files: \.exs*$ + - id: mix-lint + name: 'elixir: mix credo' + entry: mix credo --strict + language: system + pass_filenames: false + files: \.exs*$ + - id: mix-compile + name: 'elixir: mix compile' + entry: mix compile --force --warnings-as-errors + language: system + pass_filenames: false + files: \.ex$ + + # Standard pre-commit hooks + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v2.3.0 hooks: - - id: check-yaml - - id: end-of-file-fixer - - id: trailing-whitespace + - id: check-yaml + - id: check-merge-conflict + - id: end-of-file-fixer + - id: trailing-whitespace + - id: check-merge-conflict + - id: no-commit-to-branch + args: [-b, master, -b, develop]