Skip to content

Igniter expects the definition body of Mix.Project#project to be exactly a keywordlist. #235

@franc

Description

@franc

Describe the bug
In a mix project. If the content of the project function is not a single list, then Igniter can't find the project app and returns an error suggesting that it isn't set.

compiling beacon, beacon_live_admin ✔
** (RuntimeError) Failed to parse the application name from mix.exs.

Please ensure that the `project` function in your mix.exs
file returns a keyword list with an `app` key.

    (igniter 0.5.27) lib/igniter/project/application.ex:36: anonymous fn/1 in Igniter.Project.Application.app_name/1
    (beacon 0.4.1) lib/mix/tasks/beacon.install.ex:93: 

To Reproduce
In a mix project:

def project do
  version = "0.0.0"
  [
      app: :my_app,
      version: version,
      aliases: aliases(),
      deps: deps()
  ]
end

Expected behavior
I didn't expect that anything would care about anything other than the return value of a function.
Either Igniter should look for the last list in the project function definition,
or - ideally - the return value of the function,
or at least have an error message that states that it expects the body of the project function definition to only be a keyword list.

** Runtime

  • Elixir version 1.17.3
  • Erlang version OTP 27
  • Igniter version 0.5.27

Additional context
Encountered trying to install BeaconCMS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions