@@ -339,7 +339,7 @@ defmodule Credo.Check do
339
339
end
340
340
end
341
341
342
- module_doc = moduledoc ( opts , __CALLER__ . module )
342
+ module_doc = moduledoc ( opts , __CALLER__ . module , Mix.Project . config ( ) [ :app ] )
343
343
344
344
quote do
345
345
@ moduledoc unquote ( module_doc )
@@ -503,7 +503,7 @@ defmodule Credo.Check do
503
503
end
504
504
end
505
505
506
- defp moduledoc ( opts , module ) do
506
+ defp moduledoc ( opts , module , app ) do
507
507
explanations = opts [ :explanations ]
508
508
509
509
base_priority = opts_to_string ( opts [ :base_priority ] ) || 0
@@ -526,13 +526,13 @@ defmodule Credo.Check do
526
526
"""
527
527
> #### This check is enabled by default. {: .tip}
528
528
>
529
- > [Learn how to disable it](config_file.html#checks) via `.credo.exs`.
529
+ > [Learn how to disable it](#{ credo_docs_uri ( app , " config_file.html#checks" ) } ) via `.credo.exs`.
530
530
"""
531
531
else
532
532
"""
533
533
> #### This check is disabled by default. {: .neutral}
534
534
>
535
- > [Learn how to enable it](config_file.html#checks) via `.credo.exs`.
535
+ > [Learn how to enable it](#{ credo_docs_uri ( app , " config_file.html#checks" ) } ) via `.credo.exs`.
536
536
"""
537
537
end
538
538
@@ -613,12 +613,15 @@ defmodule Credo.Check do
613
613
614
614
## General Parameters
615
615
616
- Like with all checks, [general params](check_params.html) can be applied.
616
+ Like with all checks, [general params](#{ credo_docs_uri ( app , " check_params.html" ) } ) can be applied.
617
617
618
- Parameters can be configured via the [`.credo.exs` config file](config_file.html).
618
+ Parameters can be configured via the [`.credo.exs` config file](#{ credo_docs_uri ( app , " config_file.html" ) } ).
619
619
"""
620
620
end
621
621
622
+ defp credo_docs_uri ( :credo , path ) , do: path
623
+ defp credo_docs_uri ( _other_app , path ) , do: "`e:credo:#{ path } `"
624
+
622
625
defp opts_to_string ( value ) do
623
626
{ result , _ } =
624
627
value
0 commit comments