Closed kianmeng closed 3 years ago
:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart:
Thanks! I generally don't accept mix formatting PRs but all of the code formatted code here looked good without intervention, so :+1:.
Thanks! I generally don't accept mix formatting PRs but all of the code formatted code here looked good without intervention, so .
Noted. One question, for any legacy Elixir modules (created before Elixir 1.6), should we mix format
it to update it to the latest code format or let it be?
I believe running mix format on existing projects is not really about whether they're using Elixir v1.7+ but more about code churn. For example, we likely wouldn't accept a PR to Ecto that mix formats everything because:
a) there's a ton of code and we'd likely require a lot manual interventions b) it would mess up git history
I believe running mix format on existing projects is not really about whether they're using Elixir v1.7+ but more about code churn. For example, we likely wouldn't accept a PR to Ecto that mix formats everything because:
a) there's a ton of code and we'd likely require a lot manual interventions b) it would mess up git history
Noted and thanks for the explanation. If I encounter these type of legacy modules without code format, I will opt to raise a ticket instead and up to the module owner to mix format the whole repository or not.
Git history can be dealt with using the relatively new --ignore-rev
option to git blame
to jump over the formatting commits.
There's a third reason, though, important for projects maintaining multiple versions, that back-porting fixes gets harder.
Since the minimum Elixir version is 1.7+, we should mix format the the whole module.