Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

CLI cannot accept a path input, though its help and the compiler both support one

オープン
#501 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
elixir
領域
cli, compilers

調査の方向性

Start in lib/elixir_script/cli.ex:91-96 at handle_input/1, then compare its argument handling with ElixirScript.Compiler.compile/2 and the Path.wildcard/1 behavior described in the issue. Check the existing CLI process path and compiler tests before deciding how module names and filesystem paths should be distinguished. Done means a supported path reaches the compiler without breaking module-name input, with regression coverage for both cases.

索引モデルが issue の本文から書いたものです。

説明

The CLI help advertises a path input:

usage: elixirscript <module | path> [options]
<path> the path to .ex(s) files to compile

ElixirScript.Compiler.compile/2 does support it — def compile(path, opts) when is_binary(path) plus the Path.wildcard/1 handling was added by #420 — but the CLI never passes a path through, because handle_input/1 maps every argument token through Module.concat/1:

defp handle_input(input) do
  input
  |> Enum.map(fn x -> String.split(x, [" ", ","], trim: true) end)
  |> List.flatten()
  |> Enum.map(fn x -> Module.concat([x]) end)
end

(lib/elixir_script/cli.ex:91-96)

So a path becomes an atom, the when is_binary(path) clause is unreachable from the CLI, and the compile aborts:

$ mix run -e 'ElixirScript.CLI.process({["test/fixtures/list_ops.ex"], []})'
[warn] ElixirScript: :"Elixir.test/fixtures/list_ops.ex" is missing or unavailable
** (MatchError) no match of right hand side value: nil
    lib/elixir_script/passes/find_used_functions.ex:36: ElixirScript.FindUsedFunctions.walk_module/2

Passing the same path straight to the compiler works, so only the CLI wiring is missing.

Reproduced on cc8a08ae77a9d2e5354b19efd9007b2711e2dba7 with Elixir 1.11.4 / OTP 23.

Filed as an issue rather than a PR because a fix needs a disambiguation rule: a bare token can be either a module name or a relative path (Atom vs ./Atom, my/path vs My.Path), so "treat it as a path when it names an existing file or directory" is a behaviour change worth agreeing on first.

主要言語
Elixir
スター
1.6k
フォーク
69
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

elixirscript/elixirscript のほかの issue

elixirscript/elixirscript の issue をすべて見る

似ている issue

Elixir の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。