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

Error with mix doctor.gen.config #66

Open
lud opened this issue Jan 2, 2025 · 1 comment
Open

Error with mix doctor.gen.config #66

lud opened this issue Jan 2, 2025 · 1 comment

Comments

@lud
Copy link

lud commented Jan 2, 2025

With Elixir 1.18

mix doctor.gen.config

** (ArgumentError) tried to unquote invalid AST: %Doctor.Config{ignore_modules: [], ignore_paths: [], min_module_doc_coverage: 40, min_module_spec_coverage: 0, min_overall_doc_coverage: 50, min_overall_moduledoc_coverage: 100, min_overall_spec_coverage: 0, moduledoc_required: nil, exception_moduledoc_required: true, raise: false, reporter: Doctor.Reporters.Full, struct_type_spec_required: true, umbrella: false, failed: false}
Did you forget to escape term using Macro.escape/1?
    (elixir 1.18.1) src/elixir_quote.erl:542: :elixir_quote.argument_error/1
    (doctor 0.22.0) lib/config.ex:80: Doctor.Config.config_defaults_as_string/0
    (doctor 0.22.0) lib/mix/tasks/doctor.gen.config.ex:59: Mix.Tasks.Doctor.Gen.Config.create_config_file/0
    (doctor 0.22.0) lib/mix/tasks/doctor.gen.config.ex:48: Mix.Tasks.Doctor.Gen.Config.run/1
    (mix 1.18.1) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
    (mix 1.18.1) lib/mix/cli.ex:107: Mix.CLI.run_task/2
    ...../elixir/1.18.1-otp-26/bin/mix:2: (file)

It can be fixed by changing:

config = quote do: unquote(%Config{})

to:

config = quote do: unquote(Macro.escape %Config{})

But this does not seem specific to Elixir 1.18, maps cannot be unquoted as-is since a long time ago. I may be missing something.

@janpieper
Copy link

I also have this issue 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants