dogma
1.0.0
Elixir v1.6의 새로운 Formatter를 사용하면 더 이상 교리를 사용하는 것이 없다고 생각합니다. 이 린터를 사용해 주셔서 감사합니다. 재미있었습니다 :)
교리는 당국이 논의 할 수 없을 정도로 사실로 제시 한 원칙 또는 원칙입니다.
또한 수치심에 의해 구동되는 Elixir의 코드 스타일 린터이기도합니다.
Dogma는 프로젝트 내에서 일관된 Elixir 코드 스타일을 시행하기위한 도구입니다. 아이디어는 코드를 읽기 쉬운 경우 이해하기가 더 쉬워야한다는 아이디어입니다. 구성 가능하므로 스타일 가이드에 맞게 조정할 수 있지만 제정신 기본값 세트가 제공되므로 대부분의 사람들에게는 상자 밖으로 작동해야합니다. 테스트 스위트와 함께 CI 서버에서 Dogma를 실행하는 것을 좋아하고 Dogma가 문제를보고하면 빌드가 깨진 것을 고려합니다.
스타일 가이드를 엄격히 시행하기보다는 스타일 제안을하는 데 더 많은 도구에 관심이 있다면 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
얼마나 편리합니다!
모든 디렉토리에서 Dogma를 실행하려면 ESCRAT를 작성합니다.
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.