Skip to content

Commit

Permalink
Disable the Credo on the CoreComponent file
Browse files Browse the repository at this point in the history
  • Loading branch information
andyduong1920 committed Mar 15, 2023
1 parent 20a369e commit 0ff5849
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/nimble_template/helpers/credo.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ defmodule NimbleTemplate.CredoHelper do
project
|> get_files_containing_single_expression()
|> disable_rules(@do_single_expression_rule_name)

disable_on_core_components(project)
end

@spec suppress_credo_warnings_for_phoenix_api_project(Project.t()) :: :ok
Expand Down Expand Up @@ -70,4 +72,13 @@ defmodule NimbleTemplate.CredoHelper do
""")
end
end

defp disable_on_core_components(%Project{web_path: web_path}) do
Generator.prepend_content(
"#{web_path}/components/core_components.ex",
"""
# credo:disable-for-this-file Credo.Check.Design.AliasUsage, Credo.Check.Readability.StrictModuleLayout
"""
)
end
end

0 comments on commit 0ff5849

Please sign in to comment.