[#1] Setting up the project with Credo and Dialyzer
This commit is contained in:
parent
e83c5ddf77
commit
abaa798839
29
README.md
29
README.md
|
@ -1 +1,28 @@
|
|||
# poa-netstats
|
||||
# POAAgent
|
||||
|
||||
**TODO: Add description**
|
||||
|
||||
## Run
|
||||
|
||||
POAAgent is an Elixir application, in order to run it first we need to fetch the dependencies and compile it.
|
||||
|
||||
```
|
||||
mix deps.get
|
||||
mix deps.compile
|
||||
mix compile
|
||||
```
|
||||
|
||||
## Run Tests
|
||||
|
||||
In order to run the tests we have to run the command
|
||||
|
||||
```
|
||||
mix test
|
||||
```
|
||||
|
||||
`POAAgent` comes also with a code analysis tool [Credo](https://github.com/rrrene/credo) and a types checker tool [Dialyxir](https://github.com/jeremyjh/dialyxir). In order to run them we have to run
|
||||
|
||||
```
|
||||
mix credo
|
||||
mix dialyzer
|
||||
```
|
|
@ -0,0 +1 @@
|
|||
use Mix.Config
|
|
@ -0,0 +1,9 @@
|
|||
defmodule POAAgent do
|
||||
@moduledoc """
|
||||
Documentation for PoaAgent.
|
||||
"""
|
||||
|
||||
def hello do
|
||||
:world
|
||||
end
|
||||
end
|
|
@ -0,0 +1,26 @@
|
|||
defmodule POAAgent.MixProject do
|
||||
use Mix.Project
|
||||
|
||||
def project do
|
||||
[
|
||||
app: :poa_agent,
|
||||
version: "0.1.0",
|
||||
elixir: "~> 1.6",
|
||||
start_permanent: Mix.env() == :prod,
|
||||
deps: deps()
|
||||
]
|
||||
end
|
||||
|
||||
def application do
|
||||
[
|
||||
extra_applications: [:logger]
|
||||
]
|
||||
end
|
||||
|
||||
defp deps do
|
||||
[
|
||||
{:credo, "~> 0.9", only: [:dev, :test], runtime: false},
|
||||
{:dialyxir, "~> 0.5", only: [:dev], runtime: false}
|
||||
]
|
||||
end
|
||||
end
|
|
@ -0,0 +1,6 @@
|
|||
%{
|
||||
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [], [], "hexpm"},
|
||||
"credo": {:hex, :credo, "0.9.2", "841d316612f568beb22ba310d816353dddf31c2d94aa488ae5a27bb53760d0bf", [], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:poison, ">= 0.0.0", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm"},
|
||||
"dialyxir": {:hex, :dialyxir, "0.5.1", "b331b091720fd93e878137add264bac4f644e1ddae07a70bf7062c7862c4b952", [], [], "hexpm"},
|
||||
"poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [], [], "hexpm"},
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
defmodule POAAgentTest do
|
||||
use ExUnit.Case
|
||||
doctest POAAgent
|
||||
|
||||
test "greets the world" do
|
||||
assert POAAgent.hello() == :world
|
||||
end
|
||||
end
|
|
@ -0,0 +1 @@
|
|||
ExUnit.start()
|
Loading…
Reference in New Issue