nicene icon indicating copy to clipboard operation
nicene copied to clipboard

Guard against hyphens in sourcecode filenames

Open mz2 opened this issue 4 years ago • 3 comments

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

mz2 avatar Jun 02 '20 07:06 mz2

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

mpotra avatar Jun 02 '20 07:06 mpotra

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?

mz2 avatar Jun 02 '20 07:06 mz2

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.

ciaran avatar Jun 03 '20 14:06 ciaran