sketch-hq / nicene

Additional Credo checks
MIT License
39 stars 7 forks source link

Guard against hyphens in sourcecode filenames #13

Open mz2 opened 4 years ago

mz2 commented 4 years ago

Guard against hyphens in sourcecode filenames (and advise using underscores instead?)

mpotra commented 4 years ago

For clarity, this should check against module names Warn: defmodule :"Elixir.Sketchql.Repo.Migrations.Fix-projects-name-column" Expected: defmodule Sketchql.repo.Migrations.FixProjectsNameColumn

mz2 commented 4 years ago

Well, I also wouldn't want hyphens in the filenames. Looks like https://github.com/mirego/credo_naming would help us both things me and you are proposing checking + lots more?

ciaran commented 4 years ago

I tested credo_naming, it should work for this but will require a credo update (fine but seems like it will need a few Nicene updates), but we also already have the Nicene.FileAndModuleName check which is duplicated in credo_naming, so we could simply add the filename check here.

Not that we currently don’t run Credo checks on migrations at all due to it being in /priv, so I’ve not made any changes.