diff --git a/.credo.exs b/.credo.exs index e4a3bc12..bb63ed52 100644 --- a/.credo.exs +++ b/.credo.exs @@ -39,6 +39,9 @@ # to `false` below: # color: true, + plugins: [ + {CredoCodeClimate, []} + ], # # You can customize the parameters of any check by adding a second element # to the tuple. diff --git a/.gitignore b/.gitignore index 5e1d8555..8f2fa310 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,4 @@ test-junit-report.xml js/junit.xml .env demo/ +codeclimate.json diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9e748a66..38c3e43b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -67,6 +67,10 @@ lint-elixir: - mix credo diff --from-git-merge-base $TARGET_SHA1 --strict -a || export EXITVALUE=1 - mix sobelow --config || export EXITVALUE=1 - exit $EXITVALUE + artifacts: + reports: + codequality: codeclimate.json + lint-front: image: node:16 diff --git a/mix.exs b/mix.exs index 499ce41c..a81301ee 100644 --- a/mix.exs +++ b/mix.exs @@ -227,7 +227,8 @@ defmodule Mobilizon.Mixfile do {:sobelow, "~> 0.8", only: [:dev, :test]}, {:doctor, "~> 0.21", only: :dev}, {:haversine, "~> 0.1.0"}, - {:ecto_dev_logger, "~> 0.7"} + {:ecto_dev_logger, "~> 0.7"}, + {:credo_code_climate, "~> 0.1.0", only: [:dev, :test]} ] ++ oauth_deps() end diff --git a/mix.lock b/mix.lock index 06a5a101..ae55d543 100644 --- a/mix.lock +++ b/mix.lock @@ -18,6 +18,7 @@ "cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"}, "cowlib": {:hex, :cowlib, "2.11.0", "0b9ff9c346629256c42ebe1eeb769a83c6cb771a6ee5960bd110ab0b9b872063", [:make, :rebar3], [], "hexpm", "2b3e9da0b21c4565751a6d4901c20d1b4cc25cbb7fd50d91d2ab6dd287bc86a9"}, "credo": {:hex, :credo, "1.6.7", "323f5734350fd23a456f2688b9430e7d517afb313fbd38671b8a4449798a7854", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "41e110bfb007f7eda7f897c10bf019ceab9a0b269ce79f015d54b0dcf4fc7dd3"}, + "credo_code_climate": {:hex, :credo_code_climate, "0.1.0", "1c4efbd11cb0244622ed5f09246b9afbbf796316ce03e78f67db6d81271d2978", [:mix], [{:credo, "~> 1.5", [hex: :credo, repo: "hexpm", optional: false]}, {:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "75529fe38056f4e229821d604758282838b8397c82e2c12e409fda16b16821ca"}, "dataloader": {:hex, :dataloader, "1.0.10", "a42f07641b1a0572e0b21a2a5ae1be11da486a6790f3d0d14512d96ff3e3bbe9", [:mix], [{:ecto, ">= 3.4.3 and < 4.0.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "54cd70cec09addf4b2ace14cc186a283a149fd4d3ec5475b155951bf33cd963f"}, "db_connection": {:hex, :db_connection, "2.4.3", "3b9aac9f27347ec65b271847e6baeb4443d8474289bd18c1d6f4de655b70c94d", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c127c15b0fa6cfb32eed07465e05da6c815b032508d4ed7c116122871df73c12"}, "decimal": {:hex, :decimal, "2.0.0", "a78296e617b0f5dd4c6caf57c714431347912ffb1d0842e998e9792b5642d697", [:mix], [], "hexpm", "34666e9c55dea81013e77d9d87370fe6cb6291d1ef32f46a1600230b1d44f577"},