Skip to content

Instantly share code, notes, and snippets.

@5thWall
Created September 2, 2015 00:02
Show Gist options
  • Save 5thWall/81af469f0b5e32e5f53d to your computer and use it in GitHub Desktop.
Save 5thWall/81af469f0b5e32e5f53d to your computer and use it in GitHub Desktop.
A projectionist config for working on the Dogma Elixir style linter.
{
"lib/dogma/rules/*.ex": {
"type": "rule",
"alternate": "test/dogma/rules/{}_test.exs",
"template": [
"defmodule Dogma.Rules.{camelcase|dot} do",
" @moduledoc \"\"\"",
" Please add a rule description. With code examples if possible."
" \"\"\"",
"",
" @behaviour Dogma.Rule",
"",
" alias Dogma.Script",
" alias Dogma.Error",
"",
" def test(script, _config \\ []) do",
" end"
"end"
]
},
"lib/*.ex": {
"type": "lib",
"alternate": "test/{}_test.exs",
"template": [
"defmodule {camelcase|dot} do",
" @moduledoc \"\"\"",
" \"\"\"",
"end"
]
},
"test/dogma/rules/*_test.exs": {
"type": "ruletest",
"alternate": "lib/dogma/rules/{}.ex",
"template": [
"defmodule Dogma.Rules.{camelcase|dot}Test do",
" use ShouldI",
"",
" alias Dogma.Rules.{camelcase|dot}",
" alias Dogma.Script",
" alias Dogma.Error",
"",
" defp apply_rule(script) do",
" script",
" |> Script.parse(\"foo.ex\")",
" |> {camelcase|dot}.test",
" end",
"end"
]
},
"test/*_test.exs": {
"type": "test",
"alternate": "lib/{}.ex",
"template": [
"defmodule {camelcase|dot}Test do",
" use ShouldI",
"end"
]
},
"*": {
"make": "mix"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment