From b5cf11ebbf7911d51bfe7fc0712093a4673f9e34 Mon Sep 17 00:00:00 2001 From: Jandro Oliva Date: Thu, 7 May 2026 08:58:33 +0200 Subject: [PATCH 1/5] chore: add git_hooks for pre-commit format check Co-Authored-By: Claude Sonnet 4.6 --- config/dev.exs | 10 ++++++++++ mix.exs | 1 + mix.lock | 2 ++ 3 files changed, 13 insertions(+) diff --git a/config/dev.exs b/config/dev.exs index becde76..695811d 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -1 +1,11 @@ import Config + +config :git_hooks, + auto_install: true, + hooks: [ + pre_commit: [ + tasks: [ + {:cmd, "mix format --check-formatted"} + ] + ] + ] diff --git a/mix.exs b/mix.exs index 96b8ef9..a0fdcd6 100644 --- a/mix.exs +++ b/mix.exs @@ -28,6 +28,7 @@ defmodule TdDfLib.MixProject do [ {:credo, "~> 1.7.11", only: [:dev, :test], runtime: false}, {:dialyxir, "~> 1.4.5", only: :dev, runtime: false}, + {:git_hooks, "~> 0.7", only: :dev, runtime: false}, {:ecto, "~> 3.12.5"}, {:ex_machina, "~> 2.8", only: :test}, {:nimble_csv, "~> 1.2"}, diff --git a/mix.lock b/mix.lock index 54d41a5..88f7eaf 100644 --- a/mix.lock +++ b/mix.lock @@ -8,10 +8,12 @@ "erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"}, "ex_machina": {:hex, :ex_machina, "2.8.0", "a0e847b5712065055ec3255840e2c78ef9366634d62390839d4880483be38abe", [:mix], [{:ecto, "~> 2.2 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: true]}], "hexpm", "79fe1a9c64c0c1c1fab6c4fa5d871682cb90de5885320c187d117004627a7729"}, "file_system": {:hex, :file_system, "1.1.0", "08d232062284546c6c34426997dd7ef6ec9f8bbd090eb91780283c9016840e8f", [:mix], [], "hexpm", "bfcf81244f416871f2a2e15c1b515287faa5db9c6bcf290222206d120b3d43f6"}, + "git_hooks": {:hex, :git_hooks, "0.8.1", "1f6a1b065638e07ed89a49804dac6c24d8ac8d27c8f9fd0e9620d5bef8c30f41", [:mix], [{:recase, "~> 0.8.0", [hex: :recase, repo: "hexpm", optional: false]}], "hexpm", "267d8b82615ad439177b2a4bc2efadb7491ec1c8520dacc67ddc38c251448cbc"}, "graph": {:git, "https://github.com/Bluetab/graph.git", "b71054befe048625aeff0b3e964567d1611c96fd", [tag: "8.3.0"]}, "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, "nimble_csv": {:hex, :nimble_csv, "1.2.0", "4e26385d260c61eba9d4412c71cea34421f296d5353f914afe3f2e71cce97722", [:mix], [], "hexpm", "d0628117fcc2148178b034044c55359b26966c6eaa8e2ce15777be3bbc91b12a"}, "nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"}, + "recase": {:hex, :recase, "0.8.1", "ab98cd35857a86fa5ca99036f575241d71d77d9c2ab0c39aacf1c9b61f6f7d1d", [:mix], [], "hexpm", "9fd8d63e7e43bd9ea385b12364e305778b2bbd92537e95c4b2e26fc507d5e4c2"}, "redix": {:hex, :redix, "1.5.2", "ab854435a663f01ce7b7847f42f5da067eea7a3a10c0a9d560fa52038fd7ab48", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:nimble_options, "~> 0.5.0 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "78538d184231a5d6912f20567d76a49d1be7d3fca0e1aaaa20f4df8e1142dcb8"}, "td_cache": {:git, "https://github.com/Bluetab/td-cache.git", "a460e0e680b1e8c78a9239d70b5b1179ae16f74d", [tag: "8.3.0"]}, "telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"}, From 48fa52a96981f0a881106adf6cf8aea06a56196a Mon Sep 17 00:00:00 2001 From: Jandro Oliva Date: Thu, 7 May 2026 11:53:35 +0200 Subject: [PATCH 2/5] chore: add quality CI check, remove git_hooks --- .github/workflows/quality.yml | 16 ++++++++++++++++ config/dev.exs | 9 --------- mix.exs | 8 +++++++- 3 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/quality.yml diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml new file mode 100644 index 0000000..e486bcf --- /dev/null +++ b/.github/workflows/quality.yml @@ -0,0 +1,16 @@ +name: quality +on: push + +jobs: + quality: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + - uses: erlef/setup-elixir@v1 + with: + otp-version: "27.2" + elixir-version: "1.18.1" + - run: mix deps.get + - run: mix quality + diff --git a/config/dev.exs b/config/dev.exs index 695811d..d4c174a 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -1,11 +1,2 @@ import Config -config :git_hooks, - auto_install: true, - hooks: [ - pre_commit: [ - tasks: [ - {:cmd, "mix format --check-formatted"} - ] - ] - ] diff --git a/mix.exs b/mix.exs index a0fdcd6..7123547 100644 --- a/mix.exs +++ b/mix.exs @@ -8,6 +8,7 @@ defmodule TdDfLib.MixProject do elixir: "~> 1.18", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod, + aliases: aliases(), deps: deps() ] end @@ -28,11 +29,16 @@ defmodule TdDfLib.MixProject do [ {:credo, "~> 1.7.11", only: [:dev, :test], runtime: false}, {:dialyxir, "~> 1.4.5", only: :dev, runtime: false}, - {:git_hooks, "~> 0.7", only: :dev, runtime: false}, {:ecto, "~> 3.12.5"}, {:ex_machina, "~> 2.8", only: :test}, {:nimble_csv, "~> 1.2"}, {:td_cache, git: "https://github.com/Bluetab/td-cache.git", tag: "8.3.0"} ] end + + defp aliases do + [ + quality: ["format --check-formatted", "credo --strict"] + ] + end end From 9bc609a15b0b286e1a977f85378a7dc63c1282dd Mon Sep 17 00:00:00 2001 From: Jandro Oliva Date: Thu, 7 May 2026 12:22:19 +0200 Subject: [PATCH 3/5] fix: replace quality.yml with unified main.yml workflow --- .github/workflows/main.yml | 29 +++++++++++++++++++++++++++++ .github/workflows/quality.yml | 16 ---------------- 2 files changed, 29 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/main.yml delete mode 100644 .github/workflows/quality.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..0093308 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,29 @@ +name: test +on: push + +jobs: + test: + runs-on: ubuntu-20.04 + + services: + redis: + image: library/redis:6.2-alpine + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 6380:6379 + + steps: + - uses: actions/checkout@v2 + - uses: erlef/setup-elixir@v1 + with: + otp-version: "27.2" + elixir-version: "1.18.1" + - run: mix deps.get + - run: mix quality + - run: mix test + env: + REDIS_HOST: localhost diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml deleted file mode 100644 index e486bcf..0000000 --- a/.github/workflows/quality.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: quality -on: push - -jobs: - quality: - runs-on: ubuntu-20.04 - - steps: - - uses: actions/checkout@v2 - - uses: erlef/setup-elixir@v1 - with: - otp-version: "27.2" - elixir-version: "1.18.1" - - run: mix deps.get - - run: mix quality - From e08662901578b1c0d9ea3bacb647f8d3e2be1449 Mon Sep 17 00:00:00 2001 From: Jandro Oliva Date: Thu, 7 May 2026 12:23:54 +0200 Subject: [PATCH 4/5] fix: remove residual git_hooks from mix.lock, clean config/dev.exs --- config/dev.exs | 1 - mix.lock | 2 -- 2 files changed, 3 deletions(-) diff --git a/config/dev.exs b/config/dev.exs index d4c174a..becde76 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -1,2 +1 @@ import Config - diff --git a/mix.lock b/mix.lock index 88f7eaf..54d41a5 100644 --- a/mix.lock +++ b/mix.lock @@ -8,12 +8,10 @@ "erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"}, "ex_machina": {:hex, :ex_machina, "2.8.0", "a0e847b5712065055ec3255840e2c78ef9366634d62390839d4880483be38abe", [:mix], [{:ecto, "~> 2.2 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: true]}], "hexpm", "79fe1a9c64c0c1c1fab6c4fa5d871682cb90de5885320c187d117004627a7729"}, "file_system": {:hex, :file_system, "1.1.0", "08d232062284546c6c34426997dd7ef6ec9f8bbd090eb91780283c9016840e8f", [:mix], [], "hexpm", "bfcf81244f416871f2a2e15c1b515287faa5db9c6bcf290222206d120b3d43f6"}, - "git_hooks": {:hex, :git_hooks, "0.8.1", "1f6a1b065638e07ed89a49804dac6c24d8ac8d27c8f9fd0e9620d5bef8c30f41", [:mix], [{:recase, "~> 0.8.0", [hex: :recase, repo: "hexpm", optional: false]}], "hexpm", "267d8b82615ad439177b2a4bc2efadb7491ec1c8520dacc67ddc38c251448cbc"}, "graph": {:git, "https://github.com/Bluetab/graph.git", "b71054befe048625aeff0b3e964567d1611c96fd", [tag: "8.3.0"]}, "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, "nimble_csv": {:hex, :nimble_csv, "1.2.0", "4e26385d260c61eba9d4412c71cea34421f296d5353f914afe3f2e71cce97722", [:mix], [], "hexpm", "d0628117fcc2148178b034044c55359b26966c6eaa8e2ce15777be3bbc91b12a"}, "nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"}, - "recase": {:hex, :recase, "0.8.1", "ab98cd35857a86fa5ca99036f575241d71d77d9c2ab0c39aacf1c9b61f6f7d1d", [:mix], [], "hexpm", "9fd8d63e7e43bd9ea385b12364e305778b2bbd92537e95c4b2e26fc507d5e4c2"}, "redix": {:hex, :redix, "1.5.2", "ab854435a663f01ce7b7847f42f5da067eea7a3a10c0a9d560fa52038fd7ab48", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:nimble_options, "~> 0.5.0 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "78538d184231a5d6912f20567d76a49d1be7d3fca0e1aaaa20f4df8e1142dcb8"}, "td_cache": {:git, "https://github.com/Bluetab/td-cache.git", "a460e0e680b1e8c78a9239d70b5b1179ae16f74d", [tag: "8.3.0"]}, "telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"}, From 6b4e310a340478f2c3a65b6054a12a04394a5e01 Mon Sep 17 00:00:00 2001 From: Jandro Oliva Date: Thu, 7 May 2026 22:11:01 +0200 Subject: [PATCH 5/5] chore: update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74e86f0..2bdb4bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [Unreleased] + +### Added + +- [TD-8168] Add code quality control + ## [8.5.2] 2026-05-07 ### Fixed