Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

igniter.new doesn't honour the --module option of mix new. #90

Open
jimsynz opened this issue Sep 22, 2024 · 2 comments
Open

igniter.new doesn't honour the --module option of mix new. #90

jimsynz opened this issue Sep 22, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@jimsynz
Copy link

jimsynz commented Sep 22, 2024

Describe the bug
When running mix help igniter.new it clearly states that any unknown options are passed into the underlying "new task":

Creates a new project using mix new, and adds igniter to the project.

## Options

All options are passed through to mix new, except for:

  • --install - A comma-separated list of dependencies to install using mix
    igniter.install after creating the project.
  • --example - Request example code to be added to the project when
    installing packages.
  • --with - The command to use instead of new, i.e phx.new

However creating a new project and trying to override the derived module name (as per mix help new) results in the option being ignored.

To Reproduce

$ mix igniter.new foobar --module FooBar
* creating README.md
* creating .formatter.exs
* creating .gitignore
* creating mix.exs
* creating lib
* creating lib/foobar.ex
* creating test
* creating test/test_helper.exs
* creating test/foobar_test.exs

Your Mix project was created successfully.
You can use "mix" to compile it, test it, and more:

    cd foobar
    mix test

Run "mix help" for more commands.

$ grep defmodule foobar/lib/foobar.ex
defmodule Foobar do

Expected behavior

The generated modules should begin with the name FooBar not Foobar.

** Runtime

  • Elixir version 1.17.0
  • Erlang version 27.0
  • OS macOS Sequoia 15.0
  • Igniter version 0.2.4
  • any related extension versions

Additional context
Add any other context about the problem here.

@jimsynz jimsynz added the bug Something isn't working label Sep 22, 2024
@zachdaniel
Copy link
Contributor

hmmm....did you update to the latest hex archive? i don't see why we'd be ignoring it.

@zachdaniel
Copy link
Contributor

"All options are passed through to mix new, except for:" is a lie. we only pass known options to mix.new, and everything else comes from --with-arts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants