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

Use Macro.to_string/1 instead of parsing specs by "hand" #34

Merged
merged 12 commits into from
Oct 17, 2023

Conversation

Blatts12
Copy link
Contributor

@Blatts12 Blatts12 commented Oct 9, 2023

No description provided.

@Blatts12 Blatts12 requested a review from szsoppa October 9, 2023 12:30
@Blatts12 Blatts12 self-assigned this Oct 9, 2023
@Blatts12 Blatts12 changed the title Fix type formatting for [] Fix type formatting for [], integer, range and bitstrings Oct 10, 2023
@Blatts12 Blatts12 removed the request for review from szsoppa October 10, 2023 10:27
@Blatts12 Blatts12 marked this pull request as draft October 10, 2023 10:27
@Blatts12 Blatts12 changed the title Fix type formatting for [], integer, range and bitstrings Fix type formatting for [], integer, range, bitstrings, nested types and guards Oct 10, 2023
@Blatts12 Blatts12 changed the title Fix type formatting for [], integer, range, bitstrings, nested types and guards Fix type formatting for [], integer, range, bitstrings and nested types Oct 11, 2023
@Blatts12 Blatts12 changed the title Fix type formatting for [], integer, range, bitstrings and nested types Use Macro.to_string/1 instead of parsing specs by "hand" Oct 12, 2023
@Blatts12 Blatts12 requested a review from szsoppa October 12, 2023 04:45
@Blatts12 Blatts12 marked this pull request as ready for review October 12, 2023 04:46
defp format_type({:type, _, type_name, _}, _module), do: "#{type_name}()"
@spec build_spec(tuple()) :: String.t()
defp build_spec({{function_name, _arity}, spec}) do
first_spec = hd(spec)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it mean there can be more of these? Meaning, does spec hold multiple definitions of specs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does hold multiple specs for one function. I have added support for multiple specs.

@Blatts12 Blatts12 requested a review from szsoppa October 13, 2023 06:13
@szsoppa szsoppa merged commit 1310f05 into main Oct 17, 2023
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 this pull request may close these issues.

2 participants