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

Failed on erl modules #43

Closed
cgnv opened this issue Feb 11, 2022 · 0 comments · Fixed by #60
Closed

Failed on erl modules #43

cgnv opened this issue Feb 11, 2022 · 0 comments · Fixed by #60

Comments

@cgnv
Copy link

cgnv commented Feb 11, 2022

mix doctor fails with

** (FunctionClauseError) no function clause matching in Doctor.ModuleInformation.build/2    
    
    The following arguments were given to Doctor.ModuleInformation.build/2:
    
        # 1
        {:error, :chunk_not_found}
    
        # 2
        :my_app
    
    Attempted function clauses (showing 1 out of 1):
    
        def build({docs_version, _annotation, _language, _format, module_doc, metadata, docs}, module)
    
    (doctor 0.18.0) lib/module_information.ex:45: Doctor.ModuleInformation.build/2
    (elixir 1.12.3) lib/enum.ex:1582: Enum."-map/2-lists^map/1-0-"/2
    (elixir 1.12.3) lib/enum.ex:1582: Enum."-map/2-lists^map/1-0-"/2
    (doctor 0.18.0) lib/cli/cli.ex:20: Doctor.CLI.generate_module_report_list/1
    (doctor 0.18.0) lib/mix/tasks/doctor.ex:88: Mix.Tasks.Doctor.run_default/1
    (mix 1.12.3) lib/mix/task.ex:394: anonymous fn/3 in Mix.Task.run_task/3
    (mix 1.12.3) lib/mix/cli.ex:84: Mix.CLI.run_task/2

on any erl module. It is possible to skip modules and paths with config options ignore_modules and ignore_paths, but filtering (filter_ignore_modules, filter_ignore_paths) is called after fetching docs (Code.fetch_docs/1). Could we call filtering earlier?
Source of possible solution:

doctor/lib/cli/cli.ex

Lines 19 to 24 in 9e6411e

# Fetch the module information from the list of application modules
|> Enum.map(&generate_module_entry/1)
# Filter out any files/modules that were specified in the config
|> Enum.reject(fn module_info -> filter_ignore_modules(module_info.module, args.ignore_modules) end)
|> Enum.reject(fn module_info -> filter_ignore_paths(module_info.file_relative_path, args.ignore_paths) end)

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

Successfully merging a pull request may close this issue.

1 participant