dogma
1.0.0
Elixir v1.6の新しいフォーマッタでは、Dogmaの使用がもうないと思います。このリナーを使ってくれてありがとう、それは楽しかったです:)
ドグマは、議論の余地なく真実として権威によって定められた原則または一連の原則です。
また、Elixirのコードスタイルのリナーでもあり、恥をかきます。
Dogmaは、プロジェクト内で一貫したElixirコードスタイルを実施するためのツールであり、コードが読みやすくすれば理解しやすいという考えです。スタイルガイドに適合するように調整できますが、デフォルトの正気なセットが付属しているため、ほとんどの人にとっては、すぐに機能するはずです。私はテストスイートを使用してCIサーバーでドグマを実行するのが好きで、ドグマが問題を報告する場合、ビルドが壊れていると考えています。
スタイルガイドを厳密に施行するのではなく、スタイルの提案を作成することに向けたツールに興味がある場合は、CREDOをチェックしてください。
ミックス依存関係にドグマを追加します
# mix.exs
def deps do
[
{ :dogma , "~> 0.1" , only: :dev } ,
]
endフェッチ:
mix deps.get
ミックスタスクを実行します:
mix dogma
あなたはこのようなものを手に入れます:
Inspecting 27 files.
.....X..........X..........
27 files, 2 errors!
== lib/dogma/rules.ex ==
23: TrailingBlankLines: Blank lines detected at end of file
== test/dogma/formatter_test.exs ==
9: TrailingWhitespace: Trailing whitespace detected
なんて便利だ!
任意のディレクトリからドグマを実行するために、EScriptを構築します。
mix escript.build
これにより、パスに配置してどこからでも呼び出すことができる実行可能ファイルが作成されます。
mix test # Run tests once
mix test.watch # Run tests on file changes
mix dogma # Dogfooding- run the linter!それらをhexdocsでチェックアウトするか、自分で生成します。
mix docs Dogma - A code style linter for Elixir, powered by shame.
Copyright © 2015 Louis Pilfold - MIT Licence
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.