-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Replace keyword with concrete keyword lists in specs #14611
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
Conversation
…s taking options argument Add missing documentation for some of the supported options Add specs for functions with options argumnet
lib/elixir/lib/io.ex
Outdated
@@ -128,6 +128,37 @@ defmodule IO do | |||
@type nodata :: {:error, term} | :eof | |||
@type chardata :: String.t() | maybe_improper_list(char | chardata, String.t() | []) | |||
|
|||
@type inspect_opts :: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we reuse Inspect.Opts.new_opts here? If not, let's make sure to remove the deprecated options too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful, just one tiny comment and we are good to go!
Remove deprecated char_lists option
CI is failing, can you please take a look? Please rebase if necessary. :) |
💚 💙 💜 💛 ❤️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dialyzer found some issues with the new specs: https://github.com/michallepicki/elixir-lang-dialyzer-runs/actions/runs/15991154777/job/45104525189
@@ -58,7 +65,7 @@ defmodule IEx.Broker do | |||
@doc """ | |||
Client requests a takeover. | |||
""" | |||
@spec take_over(binary, iodata, keyword) :: | |||
@spec take_over(binary, iodata, take_over_opts) :: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This spec needs to cover options passed in from lib/iex/lib/iex/pry.ex:40 , so binding
, dot_iex
, env
and stacktrace
""" | ||
@spec to_quoted(term(), to_quoted_opts) :: String.t() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy-paste mistake, this should be a spec for to_quoted_string
[{Path.t(), Path.t()}], | ||
atom(), | ||
atom(), | ||
compile_opts, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to support opts passed from compile.yecc.ex
and compile.leex.ex
, I think all_warnings
and verbose
are currently missing
Thank you, I am pushing some fixes. A couple of those changes are also pass through and we were limiting the interface. I already had some WIP locally, I will include your feedback as I wrap up. |
This PR:
Rationale:
I originally planned to do this only for public functions, but I realized that it would be better to do it for all functions taking options argument. Some of the internal ones were already documented or had specs.