Skip to content

Commit

Permalink
Merge pull request #38 from qdentity/gettext
Browse files Browse the repository at this point in the history
Add built-in gettext check
  • Loading branch information
karolsluszniak authored Feb 29, 2024
2 parents 85ef058 + 7b87325 commit c569d96
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def deps do
{:dialyxir, ">= 0.0.0", only: [:dev], runtime: false},
{:doctor, ">= 0.0.0", only: [:dev], runtime: false},
{:ex_doc, ">= 0.0.0", only: [:dev], runtime: false},
{:gettext, ">= 0.0.0", only: [:dev], runtime: false},
{:sobelow, ">= 0.0.0", only: [:dev], runtime: false},
{:mix_audit, ">= 0.0.0", only: [:dev], runtime: false}
]
Expand Down
1 change: 1 addition & 0 deletions lib/ex_check/config/default.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ defmodule ExCheck.Config.Default do
{:ex_doc, "mix docs", detect: [{:package, :ex_doc}]},
{:ex_unit, "mix test", detect: [{:file, "test"}], retry: "mix test --failed"},
{:dialyzer, "mix dialyzer", detect: [{:package, :dialyxir}]},
{:gettext, "mix gettext.extract --check-up-to-date", detect: [{:package, :gettext}]},
{:npm_test, "npm test", cd: "assets", detect: [{:file, "package.json", else: :disable}]}
]

Expand Down
3 changes: 3 additions & 0 deletions lib/mix/tasks/check.ex
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ defmodule Mix.Tasks.Check do
- [`:ex_doc`] - compiles the project documentation in order to ensure that there are no issues
that would make it impossible for docs to get collected and assembled
- [`:gettext`] - verifies that your POT files are up to date with the current state of the codebase
- [`:mix_audit`] - scans the project's Mix dependencies for known Elixir security vulnerabilities
based on a GitHub-sourced list of security advisories
Expand Down Expand Up @@ -253,6 +255,7 @@ defmodule Mix.Tasks.Check do
[`:doctor`]: https://github.com/akoutmos/doctor
[`:ex_doc`]: https://hexdocs.pm/ex_doc
[`:ex_unit`]: https://hexdocs.pm/ex_unit
[`:gettext`]: https://hexdocs.pm/gettext
[`:formatter`]: https://hexdocs.pm/mix/Mix.Tasks.Format.html
[`:npm_test`]: https://docs.npmjs.com/cli/test.html
[`:sobelow`]: https://hexdocs.pm/sobelow
Expand Down
1 change: 1 addition & 0 deletions test/ex_check/project_cases/config_and_scripts_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ defmodule ExCheck.ProjectCases.ConfigAndScriptsTest do
end

refute plain_output =~ "credo skipped due to missing package credo"
refute plain_output =~ "gettext skipped due to missing package credo"
assert plain_output =~ "my_mix_task success"
assert plain_output =~ "my_elixir_script success"
assert plain_output =~ "my_shell_script success"
Expand Down
3 changes: 2 additions & 1 deletion test/ex_check/project_cases/external_tools_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule ExCheck.ProjectCases.ExternalToolsTest do
if Version.match?(System.version(), "< 1.10.0") do
[:ex_check, :credo, :doctor, :sobelow, :mix_audit]
else
[:ex_check, :credo, :doctor, :ex_doc, :sobelow, :mix_audit]
[:ex_check, :credo, :doctor, :ex_doc, :gettext, :sobelow, :mix_audit]
end

set_mix_deps(project_dir, tools)
Expand All @@ -17,6 +17,7 @@ defmodule ExCheck.ProjectCases.ExternalToolsTest do
assert output =~ "formatter success"
assert output =~ "ex_unit success"
assert output =~ "credo success"
assert output =~ "gettext success"

if Version.match?(System.version(), ">= 1.8.0") do
assert output =~ "doctor success"
Expand Down
1 change: 1 addition & 0 deletions test/ex_check/project_cases/manifest_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ defmodule ExCheck.ProjectCases.ManifestTest do
SKIP doctor
SKIP sobelow
SKIP ex_doc
SKIP gettext
SKIP mix_audit
SKIP dialyzer
"""
Expand Down

0 comments on commit c569d96

Please sign in to comment.