Initializing the project

dnovais

Diego Novais

Posted on August 26, 2022

Initializing the project

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
Enter fullscreen mode Exit fullscreen mode

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
#...
Enter fullscreen mode Exit fullscreen mode
  • 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
#...
Enter fullscreen mode Exit fullscreen mode

And then, we need to install the dependencies running this command:

mix deps.get
Enter fullscreen mode Exit fullscreen mode

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

💖 💪 🙅 🚩
dnovais
Diego Novais

Posted on August 26, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related