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

Typespec fixes + Fix to Earmark.Context.clear/1 #165

Merged
merged 4 commits into from
Nov 26, 2017

Conversation

asummers
Copy link
Contributor

Added some @types and resolved a few typspec errors (Map.t not existing, e.g.).

While doing so, I noticed Earmark.Context.clear/1 was not piping the context through to put_in/3 so it was losing the clearing of value. Not sure what bugs that caused for others, but I'm not sure that has worked properly.

@type t :: %__MODULE__{
options: Earmark.Options.t,
links: map(),
rules: Keyword.t(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this can be nil as well?

@RobertDober
Copy link
Collaborator

@asummers I'll have a look concerning your remark and merge as soon as I can fix Travis (probabaly just a relaunch needed)
Thank you.

@joshsmith
Copy link
Contributor

It's possible we want to open a follow-up issue to add a unit or regression test for the clear/1 since it was bugged before.

@joshsmith
Copy link
Contributor

Also looks like Travis is good again. 🤖 🎉

@RobertDober RobertDober merged commit dc13d96 into pragdave:master Nov 26, 2017
@joshsmith
Copy link
Contributor

Is it possible for us to push a new patch version to hex?

@RobertDober
Copy link
Collaborator

No this can only be done by @pragdave , anticipating his question and also not having finished the milestone I would like to ask though, what value do these type fixes give you in production?

Could you supress your warnings in your projects with something like that

─> $ cat dialyzer.ignore-warnings                                                                                                                                      [7:45:25]
/home/robert/.asdf/installs/erlang/20.1/lib/erlang/lib/parsetools-2.1.5/include/leexinc.hrl:276: Function yyrev/2 will never be called

That all said, if it is really important I can of course ask Dave.

@joshsmith
Copy link
Contributor

We’re using the ignore-warnings but there is an actual bug fixed in this PR and not just the type specs.

@RobertDober
Copy link
Collaborator

oops sorry to be so superficial... trying not to ignore you as your help is appreciated, then running too fast.

I'll ask @pragdave tonight!

@joshsmith
Copy link
Contributor

No worries, I understand!

@RobertDober
Copy link
Collaborator

Ok there was a bug in the code, I fixed it, and asked for a release.

@RobertDober
Copy link
Collaborator

Unfortunately @pragdave could not publish the hex package

13∙15∙26≻ mix hex.publish
Publishing earmark 1.2.4
  App: earmark
  Name: earmark
  Files:
    lib/earmark.ex
    lib/earmark/#html_renderer.ex#
    lib/earmark/#inline.ex#
    lib/earmark/block.ex
    lib/earmark/cli.ex
    lib/earmark/context.ex
    lib/earmark/error.ex
    lib/earmark/helpers.ex
    lib/earmark/helpers/attr_parser.ex
    lib/earmark/helpers/html_helpers.ex
    lib/earmark/helpers/leex_helpers.ex
    lib/earmark/helpers/line_helpers.ex
    lib/earmark/helpers/link_parser.ex
    lib/earmark/helpers/lookahead_helpers.ex
    lib/earmark/helpers/reparse_helpers.ex
    lib/earmark/helpers/string_helpers.ex
    lib/earmark/helpers/yecc_helpers.ex
    lib/earmark/html_renderer.ex
    lib/earmark/inline.ex
    lib/earmark/line.ex
    lib/earmark/message.ex
    lib/earmark/options.ex
    lib/earmark/parser.ex
    lib/earmark/plugin.ex
    lib/earmark/scanner.ex
    lib/earmark/types.ex
    src/link_text_lexer.erl
    src/link_text_lexer.xrl
    src/link_text_parser.erl
    src/link_text_parser.yrl
    src/string_lexer.erl
    src/string_lexer.xrl
    tasks/docs.exs
    tasks/readme.exs
    mix.exs
    README.md
  Description: Earmark is a pure-Elixir Markdown converter.

It is intended to be used as a library (just call Earmark.as_html),
but can also be used as a command-line tool (run mix escript.build
first).

Output generation is pluggable.
  Version: 1.2.4
  Build tools: mix
  Licenses: Apache 2 (see the file LICENSE for details)
  Maintainers: Robert Dober <<a href="mailto:robert.dober@gmail.com" target="_blank">robert.dober@gmail.com</a>>, Dave Thomas <<a href="mailto:dave@pragdave.me" target="_blank">dave@pragdave.me</a>>
  Links: 
    GitHub: [https://github.com/pragdave/earmark](https://github.com/pragdave/earmark)
  Elixir: ~> 1.4
Before publishing, please read the Code of Conduct: [https://hex.pm/policies/codeofconduct](https://hex.pm/policies/codeofconduct)
Proceed? [Yn] 
Building docs...
** (UndefinedFunctionError) function :elixir_erl.debug_info/4 is undefined (module :elixir_erl is not available)
    :elixir_erl.debug_info(:erlang_v1, Earmark.Block.BlockQuote, {:elixir_v1, %{attributes: [], compile_opts: [], definitions: [{{:__struct__, 1}, :def, [l
ine: 23, generated: true], [{[line: 23, generated: true], [{:kv, [counter: -576460752303306908, line: 23], Kernel}], [], {{:., [line: 23], [Enum, :reduce]}
, [line: 23], [{:kv, [counter: -576460752303306908, line: 23], Kernel}, {:%{}, [line: 23], [__struct__: Earmark.Block.BlockQuote, attrs: nil, blocks: [], l
nb: 0]}, {:fn, [line: 23], [{:->, [line: 23], [[{{:key, [counter: -576460752303306908, line: 23], Kernel}, {:val, [counter: -576460752303306908, line: 23],
 Kernel}}, {:map, [counter: -576460752303306908, line: 23], Kernel}], {{:., [line: 23], [:maps, :update]}, [line: 23], [{:key, [counter: -57646075230330690
8, line: 23], Kernel}, {:val, [counter: -576460752303306908, line: 23], Kernel}, {:map, [counter: -576460752303306908, line: 23], Kernel}]}]}]}]}}]}, {{:__
struct__, 0}, :def, [line: 23, generated: true], [{[line: 23, generated: true], [], [], {:%{}, [line: 23], [__struct__: Earmark.Block.BlockQuote, attrs: ni
l, blocks: [], lnb: 0]}}]}], file: "/Users/dave/Played/earmark/lib/earmark/block.ex", line: 23, module: Earmark.Block.BlockQuote, unreachable: []}, []}, []
)                                                                                                                                                         
    (elixir) lib/kernel/typespec.ex:300: Kernel.Typespec.abstract_code/1
    (elixir) lib/kernel/typespec.ex:291: Kernel.Typespec.from_abstract_code/2
    (ex_doc) lib/ex_doc/retriever.ex:430: ExDoc.Retriever.get_specs/1
    (ex_doc) lib/ex_doc/retriever.ex:192: ExDoc.Retriever.get_module_info/2
    (ex_doc) lib/ex_doc/retriever.ex:163: ExDoc.Retriever.generate_node/3
    (elixir) lib/enum.ex:1229: Enum."-map/2-lists^map/1-0-"/2

I will need to find some time to look into this but maybe you could help to speed things up.
Ty

@RobertDober
Copy link
Collaborator

RobertDober commented Nov 29, 2017

@asummers @joshsmith Dave released 1.2.4 tonight 👍 <3 🎆

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.

3 participants