Skip to content

Commit

Permalink
Merge pull request #137 from akash-akya/dev
Browse files Browse the repository at this point in the history
Do not use reserved word as variable name
  • Loading branch information
akash-akya authored Dec 2, 2023
2 parents 987e0db + 14dba50 commit dc26c0f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
6 changes: 4 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

* Bump version and push to master branch

* Create new release at: https://github.com/akash-akya/vix/releases.
* Create new release at: https://github.com/akash-akya/vix/releases
Github Actions and TravisCI creates pre-compiled NIF artifacts and push to the release.
Wait for all the release to be available. Ensure artifacts are created for all Beam
NIF versions, like `2.16`, `2.17`

* On local machine, remove existing pre-built NIF, cache and checksum `rm -rf cache/ priv/* checksum.exs`
* Ensure all pre-built NIF packages are created

* On local machine, remove existing pre-built NIF packages, cache and checksum `rm -rf cache/ priv/* checksum.exs`

* Remove existing compiled files `rm -rf _build/*/lib/vix`

Expand Down
1 change: 1 addition & 0 deletions lib/vix/vips/operation.ex
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ defmodule Vix.Vips.Operation do
} = spec = operation_args_spec(name)

func_name = function_name(name)
in_req_spec = normalize_input_variable_names(in_req_spec)

req_params =
Enum.map(in_req_spec, fn param ->
Expand Down
10 changes: 10 additions & 0 deletions lib/vix/vips/operation_helper.ex
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,16 @@ defmodule Vix.Vips.OperationHelper do

def function_name(name), do: to_string(name) |> String.downcase() |> String.to_atom()

def normalize_input_variable_names(specs) do
Enum.map(specs, fn
%{param_name: "in"} = param ->
%{param | param_name: "input"}

param ->
param
end)
end

def atom_typespec_ast(list) do
Enum.reduce(list, &{:|, [], [&1, &2]})
end
Expand Down

0 comments on commit dc26c0f

Please sign in to comment.