mirego / credo_naming

🏷 A suite of Credo checks to enforce naming best practices in an Elixir project
https://open.mirego.com
BSD 3-Clause "New" or "Revised" License
88 stars 9 forks source link

One arity function in :plugins opt #28

Closed paveltyk closed 10 months ago

paveltyk commented 10 months ago

πŸ“– Description and reason

Currently, :plugins option supports only :phoenix. It would be nice to add some flexibility by supporting one arity function.

In my case the project folder structure does not match with the Phoenix naming convention, i.e. instead of app_web I have app_api. That prevents the predefined :phoenix plugin to do its' magic. This PR will allow for plugins: [&MyApp.Credo.check_module_fIlename/1]

πŸ‘· Work done

Tasks

Additional notes

Consider passing module name in :plugins opt. This will follow the Open Closed principle, i.e. plugins: [CredoNaming.Check.Consistency.ModuleFilename.Plugins.Phoenix]

πŸŽ‰ Result

Not needed

πŸ¦€ Dispatch

#dispatch/elixir

remi commented 10 months ago

Hi @paveltyk,

That’s great! Regarding this:

Consider passing module name in :plugins opt. This will follow the Open Closed principle, i.e. plugins: [CredoNaming.Check.Consistency.ModuleFilename.Plugins.Phoenix]

I agree! I’ll make the change in README.md after merging this.