Closed sitch closed 4 years ago
Hi @sitch,
This is a duplicate of #3 where I posted a kind of workaround.
In the current README.md there is this note:
In the future, there may be some “naming convention flavours” (eg. :default, :phoenix, etc.) to use instead of having to implement your own callback.
So if you implement a valid_filename_callback
to match the naming pattern used in Phoenix, please share 😄
Cheers!
Oh kickass thanks!
For anyone else with a similiar phoniex-esque layout (just find and replace my_app
with your app name):
{
CredoNaming.Check.Consistency.ModuleFilename,
excluded_paths: ["config", "mix.exs"],
valid_filename_callback: fn
"lib/my_app_web/channels/" <> filepart, module_name, opts ->
valid_filename?("lib/my_app_web/" <> filepart, module_name, opts)
"lib/my_app_web/controllers/" <> filepart, module_name, opts ->
valid_filename?("lib/my_app_web/" <> filepart, module_name, opts)
"lib/my_app_web/views/" <> filepart, module_name, opts ->
valid_filename?("lib/my_app_web/" <> filepart, module_name, opts)
"test/my_app_web/channels/" <> filepart, module_name, opts ->
valid_filename?("test/my_app_web/" <> filepart, module_name, opts)
"test/my_app_web/controllers/" <> filepart, module_name, opts ->
valid_filename?("test/my_app_web/" <> filepart, module_name, opts)
"test/my_app_web/views/" <> filepart, module_name, opts ->
valid_filename?("test/my_app_web/" <> filepart, module_name, opts)
filename, module_name, opts ->
valid_filename?(filename, module_name, opts)
end
},
Currently if you have something like
phoenix will put this into
So it would be useful if either in acronyms or substitutions where you could say