mneumann
Module naming of services with multiple versions
I have services that come in different versions and they all have to co-exist, possibly at the same time.
E.g. ServiceA.V1_0 and ServiceA.V1_2.
Would you use underscores in module names to separate major from minor in this case and teach credo to not issue a warning or instead write ServiceA.V10 and ServiceA.V12?
Note that the versions reflect a public specification, so I can’t change that :).
Marked As Solved
dimitarvp
Ultimately what truly matters is if you and/or your team are finding the naming convention intuitive and easy to work with. If so, just tell credo to shut up about this one particular thing.
Also Liked
sodapopcan
It’s your project so do what you want! Credo is highly configurable for a reason ![]()
D4no0
While using module names for versioning is extremely convenient, as the compiler can ensure their uniqueness, I would personally opt for the variant of placing the versioning as metadata in the module:
defmodule Test do
use ServiceA, version: "1.2"
end
This gives much more flexibility in your versioning convention and doesn’t require you to be careful about how you name the modules.







