I do not know how many of you have ever noticed that git diff
shows current scope in the diff header. This is called hunk and can be useful in long diffs. The problem is that Elixir is not a language that is supported OOtB (no surprise there), but do not worry, with some Git-fu you can get it today. Installation is simple:
$ mkdir -p ~/.config/git
$ echo '*.ex diff=elixir' >> ~/.config/git/attributes
$ echo '*.exs diff=elixir' >> ~/.config/git/attributes
$ git config --global diff.elixir.xfuncname '^[ \t]*((def(macro|module|impl|guard|protocol)?p?|test)[ \t].*)$'
And change your diffs from this:
@@ -474,7 +472,7 @@
"""
@spec reset_metadata(metadata) :: :ok
def reset_metadata(keywords \\ []) do
- :logger.set_process_metadata(%{})
+ :ok = :logger.set_process_metadata(%{})
metadata(keywords)
end
To this
@@ -474,7 +472,7 @@ def metadata() do
"""
@spec reset_metadata(metadata) :: :ok
def reset_metadata(keywords \\ []) do
- :logger.set_process_metadata(%{})
+ :ok = :logger.set_process_metadata(%{})
metadata(keywords)
end
The difference is in first line of the snippets if you missed that.