About the Project
Now that we know how the game works, let's create the project and some initial settings.
Creating the project
To create the project, we can run the command:
mix new rock_paper_scissor_elixir --module Game
We can specify the main module name of our project by passing --module NameOfTheModule
. And own main module will call Game
.
-
Adding the test coverage tool
As a good practice, we'll create our project with the maximum test coverage. And now we'll add the library test coverage tool:
coveralls
.
# /mix.exs
#...
defp deps do
[
{:excoveralls, "~> 0.10", only: :test}
]
end
#...
- Adding the static code analysis tool Now we'll add the lib Credo, a static code analysis tool for the Elixir language focused on helping us maintain the code's quality and consistency.
# /mix.exs
#...
defp deps do
[
{:excoveralls, "~> 0.10", only: :test},
{:credo, "~> 1.6", only: [:dev, :test], runtime: false}
]
end
#...
And then, we need to install the dependencies running this command:
mix deps.get
In the next post, we'll build the tests.
Contacts
Email: contato@diegonovais.com.br
Linkedin: https://www.linkedin.com/in/diegonovais/
Twitter: https://twitter.com/diegonovaistech
Top comments (0)