decorator
decorator copied to clipboard
Function decorators for Elixir
This fixed warning below: warning: clauses with the same name and arity (number of arguments) should be grouped together, "def fun1/1" was previously defined (test/decorate_all_test.exs:50) test/decorate_all_test.exs:54
Hey guys! Thank you for the great tool! I'm experimenting a bit with multiple decorators like: ```elixir @decorate foo() @decorate bar() @decorate baz() def hello() do :world end ``` Intuitively...
### Definition ```elixir defmodule ArgsValidator do use Decorator.Define, validate: 1 def validate(_, _, %{args: function_args}) do quote do: unquote(function_args) end end ``` ### Usage ```elixir use ArgsValidator @decorate validate([&Ecto.UUID.cast/1]) defdelegate...
Forgive me for using this as a venue to get a recommendation, but I'm having a really hard time even forming my question in other venues, so I thought I'd...
In [`TelemetryDecorator`](https://github.com/amplifiedai/telemetry_decorator) I'd like to return chunks of AST to sit at the module level so I can support [`TelemetryRegistry`](https://hexdocs.pm/telemetry_registry/TelemetryRegistry.html). Are you open for a PR to add this capability?...
I'm raising because my decorator arguments are bad, and the stack trace isn't giving as much help as I like to provide: ```elixir == Compilation error in file lib/my_app/my_module.ex ==...
While using decorator with Spandex i'm not able to add another use in sequence: ``` defmodule Fetcher.Info do use Spandex.Decorators use Interceptor.Annotation @intercept true @decorate span(type: :backend) def retrieve_information(resource_uuid) do...
Let's say I'd like to `decorate_all` functions that are injected by `Ecto.Repo`. I am struggling with this: ``` defmodule App.Repo do use Ecto.Repo, otp_app: :app use Decorator.Define @decorate_all function_result(:test) def...
Adds "hidden" `__decorated_functions__` function to modules that use the `@decorate` function. The new function allows unit tests to assert the decoration was properly called, thereby avoiding the need to assert...
List of changes: - bump apps version in GitHub CI - add additional jobs for more checking - use default job name - cache deps - remove unused dep