CrowdHailer / raxx

Interface for HTTP webservers, frameworks and clients
https://hexdocs.pm/raxx
Apache License 2.0
402 stars 29 forks source link

Fail build if code is not formatted #59

Closed CrowdHailer closed 6 years ago

CrowdHailer commented 6 years ago

This will have to wait until the new year when elixir 1.6 is released. The CI tests should fail if running the formatter would result in a change to the code.

Not sure if such a mix task even exists, but I think it would be good. It would however mean that raxx required 1.6 to work.

use

mix format --check-formatted mix.exs "{lib,test}/**/*.{ex,exs}"
filipecabaco commented 6 years ago

Maybe using something similar to https://docs.travis-ci.com/user/multi-os/#Example-Multi-OS-Build-Matrix with the TRAVIS_ELIXIR_VERSION environment variable?

This way it would be possible to have two commands:

Or even better, just run the formatter if TRAVIS_ELIXIR_VERSION >=1.6 and let the other command be the same.

What do you think?

CrowdHailer commented 6 years ago

Sounds a good idea. Although I am tempted to only support the latest version of Elixir to keep maintaining the project simple.

filipecabaco commented 6 years ago

After talking with some friends actually I think you are right. Overall it makes more sense, it would only be overcomplicating at this point in time.

Maintaining older versions might not bring much benefit and it will only increase development time.