From 33d1ebd38662df5dad27835624500f5039556df6 Mon Sep 17 00:00:00 2001 From: Jandro Oliva Date: Thu, 7 May 2026 08:58:36 +0200 Subject: [PATCH 1/5] chore: add git_hooks for pre-commit format check Co-Authored-By: Claude Sonnet 4.6 --- config/config.exs | 10 ++++++++++ mix.exs | 1 + mix.lock | 2 ++ 3 files changed, 13 insertions(+) diff --git a/config/config.exs b/config/config.exs index 24d6aaa..5eb39ad 100644 --- a/config/config.exs +++ b/config/config.exs @@ -1,5 +1,15 @@ import Config +config :git_hooks, + auto_install: true, + hooks: [ + pre_commit: [ + tasks: [ + {:cmd, "mix format --check-formatted"} + ] + ] + ] + config :td_core, TdCore.Search.Cluster, api: ElasticsearchMock, url: "http://none", diff --git a/mix.exs b/mix.exs index d4062d3..e0a51b8 100644 --- a/mix.exs +++ b/mix.exs @@ -35,6 +35,7 @@ defmodule TdCore.MixProject do {:xlsx_reader, "~> 0.8.7"}, {:elasticsearch, git: "https://github.com/Bluetab/elasticsearch-elixir.git"}, {:credo, "~> 1.7.11", only: [:dev, :test], runtime: false}, + {:git_hooks, "~> 0.7", only: :dev, runtime: false}, {:td_cluster, git: "https://github.com/Bluetab/td-cluster.git", tag: "8.3.0"}, {:td_cache, git: "https://github.com/Bluetab/td-cache.git", tag: "8.3.0"}, {:td_df_lib, git: "https://github.com/Bluetab/td-df-lib.git", tag: "8.5.1"} diff --git a/mix.lock b/mix.lock index 1f3dad5..533ff42 100644 --- a/mix.lock +++ b/mix.lock @@ -10,6 +10,7 @@ "elasticsearch": {:git, "https://github.com/Bluetab/elasticsearch-elixir.git", "3464e4395d02eeb55cb7e42141072f1eb9d28fd1", []}, "elixlsx": {:hex, :elixlsx, "0.6.0", "858c2c821ab52f4ca0988adce188d19f3b239a4fff8b36b26cd81ec8af9b2ab3", [:mix], [], "hexpm", "c4766f47afea075a85950a5c6fe981e98b8b8a30cc076382aaacf2bb8dbcd25d"}, "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"]}, "guardian": {:hex, :guardian, "2.3.2", "78003504b987f2b189d76ccf9496ceaa6a454bb2763627702233f31eb7212881", [:mix], [{:jose, "~> 1.8", [hex: :jose, repo: "hexpm", optional: false]}, {:plug, "~> 1.3.3 or ~> 1.4", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "b189ff38cd46a22a8a824866a6867ca8722942347f13c33f7d23126af8821b52"}, "hackney": {:hex, :hackney, "1.24.1", "f5205a125bba6ed4587f9db3cc7c729d11316fa8f215d3e57ed1c067a9703fa9", [:rebar3], [{:certifi, "~> 2.15.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.4", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.4.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "f4a7392a0b53d8bbc3eb855bdcc919cd677358e65b2afd3840b5b3690c4c8a39"}, @@ -29,6 +30,7 @@ "parse_trans": {:hex, :parse_trans, "3.4.1", "6e6aa8167cb44cc8f39441d05193be6e6f4e7c2946cb2759f015f8c56b76e5ff", [:rebar3], [], "hexpm", "620a406ce75dada827b82e453c19cf06776be266f5a67cff34e1ef2cbb60e49a"}, "plug": {:hex, :plug, "1.16.1", "40c74619c12f82736d2214557dedec2e9762029b2438d6d175c5074c933edc9d", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a13ff6b9006b03d7e33874945b2755253841b238c34071ed85b0e86057f8cddc"}, "plug_crypto": {:hex, :plug_crypto, "2.1.0", "f44309c2b06d249c27c8d3f65cfe08158ade08418cf540fd4f72d4d6863abb7b", [:mix], [], "hexpm", "131216a4b030b8f8ce0f26038bc4421ae60e4bb95c5cf5395e1421437824c4fa"}, + "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"}, "saxy": {:hex, :saxy, "1.6.0", "02cb4e9bd045f25ac0c70fae8164754878327ee393c338a090288210b02317ee", [:mix], [], "hexpm", "ef42eb4ac983ca77d650fbdb68368b26570f6cc5895f0faa04d34a6f384abad3"}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"}, From 6e77f6abf3079288f999fe1866d3f7bd8deb6317 Mon Sep 17 00:00:00 2001 From: Jandro Oliva Date: Thu, 7 May 2026 11:53:37 +0200 Subject: [PATCH 2/5] chore: add quality CI check, remove git_hooks --- .github/workflows/quality.yml | 16 ++++++++++++++++ config/config.exs | 10 ---------- mix.exs | 8 +++++++- 3 files changed, 23 insertions(+), 11 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/config.exs b/config/config.exs index 5eb39ad..24d6aaa 100644 --- a/config/config.exs +++ b/config/config.exs @@ -1,15 +1,5 @@ import Config -config :git_hooks, - auto_install: true, - hooks: [ - pre_commit: [ - tasks: [ - {:cmd, "mix format --check-formatted"} - ] - ] - ] - config :td_core, TdCore.Search.Cluster, api: ElasticsearchMock, url: "http://none", diff --git a/mix.exs b/mix.exs index e0a51b8..fce529f 100644 --- a/mix.exs +++ b/mix.exs @@ -8,6 +8,7 @@ defmodule TdCore.MixProject do elixir: "~> 1.18", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod, + aliases: aliases(), deps: deps() ] end @@ -35,10 +36,15 @@ defmodule TdCore.MixProject do {:xlsx_reader, "~> 0.8.7"}, {:elasticsearch, git: "https://github.com/Bluetab/elasticsearch-elixir.git"}, {:credo, "~> 1.7.11", only: [:dev, :test], runtime: false}, - {:git_hooks, "~> 0.7", only: :dev, runtime: false}, {:td_cluster, git: "https://github.com/Bluetab/td-cluster.git", tag: "8.3.0"}, {:td_cache, git: "https://github.com/Bluetab/td-cache.git", tag: "8.3.0"}, {:td_df_lib, git: "https://github.com/Bluetab/td-df-lib.git", tag: "8.5.1"} ] end + + defp aliases do + [ + quality: ["format --check-formatted", "credo --strict"] + ] + end end From e87d95bab21e92f41d008e7cb2e56fbc9319d1e9 Mon Sep 17 00:00:00 2001 From: Jandro Oliva Date: Thu, 7 May 2026 12:22:21 +0200 Subject: [PATCH 3/5] fix: replace quality.yml with unified main.yml workflow --- .github/workflows/{quality.yml => main.yml} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename .github/workflows/{quality.yml => main.yml} (86%) diff --git a/.github/workflows/quality.yml b/.github/workflows/main.yml similarity index 86% rename from .github/workflows/quality.yml rename to .github/workflows/main.yml index e486bcf..f338309 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/main.yml @@ -1,8 +1,8 @@ -name: quality +name: test on: push jobs: - quality: + test: runs-on: ubuntu-20.04 steps: @@ -13,4 +13,4 @@ jobs: elixir-version: "1.18.1" - run: mix deps.get - run: mix quality - + - run: mix test From 3d2facd88299a0849ac1e4613834cad3d639c109 Mon Sep 17 00:00:00 2001 From: Jandro Oliva Date: Thu, 7 May 2026 12:23:57 +0200 Subject: [PATCH 4/5] fix: remove residual git_hooks from mix.lock --- mix.lock | 2 -- 1 file changed, 2 deletions(-) diff --git a/mix.lock b/mix.lock index 533ff42..1f3dad5 100644 --- a/mix.lock +++ b/mix.lock @@ -10,7 +10,6 @@ "elasticsearch": {:git, "https://github.com/Bluetab/elasticsearch-elixir.git", "3464e4395d02eeb55cb7e42141072f1eb9d28fd1", []}, "elixlsx": {:hex, :elixlsx, "0.6.0", "858c2c821ab52f4ca0988adce188d19f3b239a4fff8b36b26cd81ec8af9b2ab3", [:mix], [], "hexpm", "c4766f47afea075a85950a5c6fe981e98b8b8a30cc076382aaacf2bb8dbcd25d"}, "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"]}, "guardian": {:hex, :guardian, "2.3.2", "78003504b987f2b189d76ccf9496ceaa6a454bb2763627702233f31eb7212881", [:mix], [{:jose, "~> 1.8", [hex: :jose, repo: "hexpm", optional: false]}, {:plug, "~> 1.3.3 or ~> 1.4", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "b189ff38cd46a22a8a824866a6867ca8722942347f13c33f7d23126af8821b52"}, "hackney": {:hex, :hackney, "1.24.1", "f5205a125bba6ed4587f9db3cc7c729d11316fa8f215d3e57ed1c067a9703fa9", [:rebar3], [{:certifi, "~> 2.15.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.4", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.4.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "f4a7392a0b53d8bbc3eb855bdcc919cd677358e65b2afd3840b5b3690c4c8a39"}, @@ -30,7 +29,6 @@ "parse_trans": {:hex, :parse_trans, "3.4.1", "6e6aa8167cb44cc8f39441d05193be6e6f4e7c2946cb2759f015f8c56b76e5ff", [:rebar3], [], "hexpm", "620a406ce75dada827b82e453c19cf06776be266f5a67cff34e1ef2cbb60e49a"}, "plug": {:hex, :plug, "1.16.1", "40c74619c12f82736d2214557dedec2e9762029b2438d6d175c5074c933edc9d", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a13ff6b9006b03d7e33874945b2755253841b238c34071ed85b0e86057f8cddc"}, "plug_crypto": {:hex, :plug_crypto, "2.1.0", "f44309c2b06d249c27c8d3f65cfe08158ade08418cf540fd4f72d4d6863abb7b", [:mix], [], "hexpm", "131216a4b030b8f8ce0f26038bc4421ae60e4bb95c5cf5395e1421437824c4fa"}, - "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"}, "saxy": {:hex, :saxy, "1.6.0", "02cb4e9bd045f25ac0c70fae8164754878327ee393c338a090288210b02317ee", [:mix], [], "hexpm", "ef42eb4ac983ca77d650fbdb68368b26570f6cc5895f0faa04d34a6f384abad3"}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"}, From 9f7a73278d529a45e0b567b4d17602ae367d3818 Mon Sep 17 00:00:00 2001 From: Jandro Oliva Date: Thu, 7 May 2026 22:11:02 +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 8ac72c5..30e8be7 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 ### Changed