ex_check v0.14: new automations & curated tools to supercharge your Elixir workflow

Just released v0.14 of ex_check - a single task that runs all analysis & testing tools in Elixir projects. It comes with a load of new features that build upon ex_check’s “drop in solution” design to bring in even more time-saving automation so you can spend more time coding & less time waiting for CI to spit out issues.

  • Fix mode resolves issues automatically for tools that provide the fix command - useful on local machines for checking & fixing in one-shot and on CI for committing automatic fixes

  • Automatic toggling of retry mode when previous run resulted in failures allows to simply call task again after failures to do a faster check focused only on tools with issues

  • Capability to run only failed tests for tools themselves complements the retry mode and further optimizes the issue fixing workflow by re-checking only what has failed

  • Doctor tool ensures that the project documentation is healthy by validating the presence of module docs, functions docs, typespecs and struct typespecs

…and a few smaller improvements. Enjoy!

IntelliJ Elixir v11.9.2

Changelog

Bug Fixes

  • Protect from nested heredocs in documentation from stopping documentation’s heredoc as happens in Module and Ecto.Query.
    • Use ~S for @moduledoc too, in addition to @doc.
    • Check if the documentation contains “”” or ‘’’ and use the opposite one as the promoter/terminator.
      • If neither is used, use “””.
      • If both are used, use “””, but then escape “”” as \”\”\”.
    • Trim trailing whitespace from documentation lines to match formatter output.
  • Set runIde maxHeapSize to 7g
    • Set to the same I run my own IDE at, so the debugged instance isn’t any slower than the normal IDE when I need to do extended all day testing to trigger bugs.
  • Test that all FormattingTest files can be parsed.
  • YYINITIAL is special - wrappers of the lexer assume that if in YYINITIAL, it is safe to shift the lexer over when there is an error, having {OPENING_CURLY} pushAndBegin(YYINITIAL) when it was either in YYINITIAL or INTERPOLATION means that the lexer looked like it was restartable when it really wasn’t. This code has been in the lexer for 6 years.
    • When in YYINITIAL, { no longer recurses into YYINITIAL as } does not need to be counted to determine if it is closing an interpolation.
    • When in INTERPOLATION, { enters INTERPOLATION_CURLY to allow counting and matching of } until it can exit and go back to INTERPOLATION, where } will exit the interpolation.
    • When in INTERPOLATION_CURLY, { enters another level of INTERPOLATION_CURLY to allow counting and matching of } until it can exit and go up a level.
  • The } in YYINITIAL did yybegin(ADDITION_OR_SUBTRACTION_MAYBE), but it should have been pushAndBegin(ADDITION_OR_SUBTRACTION) as ADDITION_OR_SUBTRACTION_MAYBE or its following states all exit with handleInLastState() or popAndBegin(). This was not caught in #1859 because the extra YYINITIAL from pushAndBegin(YYINTIAL) hid the bug.
  • Prevent nested YYINITIAL bugs in the future by erroring
    • If trying to pushAndBegin(YYINITIAL).
    • If trying to push(YYINITIAL) and the state stack is not empty
  • Clear the state Stack when ElixirFlexLexer#reset is called, as at the level of typing and pasting, the ElixirFlexLexer is wrapped in many layers of lexers including LexerEditorHighlighter where the ElixirFlexLexer is no longer re-instantiated when there is no text, but instead, ElixirFlexLexer#reset is only called. This has always been an invariant violation since the stack state was added 7 years ago. It likely only became more apparent with the changes to +/- parsing in #1859 that made return-to-YYINITIAL less likely.
    • Since this stack.clear() has to be manually added to ElixirFlexLexer.java, which is generated from Elixir.flex, ResetTest is added to check that the code is still there.
  • For a reason I haven’t been able to explain, the LexerEditorHighlighter stops working after : is typed at the start of an atom in certain situations, such as before ) inside a function call, like when adding an argument. In this case, the old version of the lexer would mark ) as a BAD_CHARACTER and continue to do so until an expected atom start of [a-zA-Z_], , , or an operator occurred. Now, if an invalid atom start is matched, the ATOM_START state ends and the previous state handles the text, which in the function case mean ) is parsed as CLOSING_PARENTHESIS. This change allows the highlighting to continue. I do not know if returning BAD_CHARACTER will always break the LexerEditorHighlighter, but I don’t think, so since the GroovyLexer in intellij-community returns it, but it may be the case that it isn’t actually returned ever when users are typing and only handled by the lexer for completeness. Installation Instructions

Understanding the Tradeoffs with Elixir Typespecs and Dialyzer

In today’s post I want to start a conversation around the tradeoffs of using Typespecs and Dialyzer use in your Elixir code.

https://mikezornek.com/posts/2021/1/typespecs-and-dialyzer/

Early access for Testing LiveView is open! 🥳

The course focuses on mastering LiveView’s new testing tools as well as learning the thought process behind writing effective LiveView tests so they’re fast, robust, and easy to maintain.

https://www.testingliveview.com/

Elixir Wizards S5E8 Matt Nowack and Jake Heinz on Elixir and Discord; Bonus: Arthi Radhakrishnan, Community.com

Latest episode of Elixir Wizards is out today! Check it out here: https://smartlogic.io/podcast/elixir-wizards/s5e8-nowack-heinz/

The best books to start, or improve your Elixir career

When you start your adventure with Elixir, you may wonder where to get the knowledge. In this article, I have prepared a list of books that may help you to become an Elixir programmer, or improve your career.

https://bartoszgorka.com/the-best-books-to-start-or-improve-your-Elixir-career

ElixirCasts 129: Phoenix LiveView LiveComponents

Get an introduction to LiveView LiveComponents and how you can use them in your Phoenix apps.

https://elixircasts.io/phoenix-liveview-livecomponent

Crafting Beautiful Emails in Elixir Using MJML

Learn how to compile your MJML email templates into EEx templates at build time and send them out using Swoosh. Also learn how to edit the Phx.Gen.Auth scaffolding in order to send out these MJML emails when users register. https://akoutmos.com/post/mjml-template-compliation/ Email Preview

phx_gen_auth and OAuth

Integrating phx_gen_auth and OAuth for a Phoenix LiveView app https://iacobson.medium.com/phx-gen-auth-and-oauth-for-a-phoenix-liveview-app-a19a27e6befa

Have you heard the good news about Elixir? (Why we chose Elixir for our MMO game server)

A look at the requirements and goals that pushed us to choose Elixir for our massive multiplayer game server, plus a post-mortem of the pros & cons of Elixir that we ran into during the implementation.

https://developer.x-plane.com/2021/01/have-you-heard-the-good-news-about-elixir/

elixir/nerves based LoRaWAN gateway server and client

finally my employer http://pmr-rnd.de published the web pages on our elixir/nerves programmable LoRaWAN gateway server http://pmr-rnd.de/lora-gateway/ and the wip page for our LoRa client http://pmr-rnd.de/lora-client/

ThinkingElixir 031: Crawling the Web using Elixir with Oleg Tarasenko and Tze Yiing

In episode 31 of Thinking Elixir, we talk with Oleg Tarasenko and Tze Yiing about crawling the web using Elixir. Oleg created the crawly project to help solve this problem and Tze Yiing joined him as a contributor and maintainer. We cover how Elixir is well suited to orchestrate crawling projects, how to deal with login pages, understanding the legal concerns, building a codeless scraper and much more!

Podcast Episode

How Absinthe Uses Compilation Callbacks for Schema Validation in Elixir

Let’s look closely at how Absinthe uses some metaprograming tricks and module attributes to provide compile-time schema validation for us.

https://blog.appsignal.com/2021/01/19/how-absinthe-uses-compilation-callbacks-for-schema-validation-in-elixir.html

Create a crypto bot in Elixir ebook updated (early alpha 2)

https://leanpub.com/create-a-cryptocurrency-trading-bot-in-elixir/

4 new chapters, All code starting from chapter 2 got refreshed, logs improved and many descriptions rephrased.

Surpassed 100 pages 🍾 Enjoy ❤️

Getting started with PETAL

As a follow-up to my post about the PETAL stack on the Changelog.com blog I put together this getting-started-guide for anyone wanting to try it out. Hope it helps: https://underjord.io/getting-started-with-petal.html

Open-source Deep Dive: Hound

Started a new blog series - Open-source Deep Dive - where I dissect an open-source project and try to understand the project and the underlying technologies that power it!

The project to kick start this series is Hound - an Elixir library for browser automation and integration testing!

For this project, I explored how browser automation works and looked at how Hound takes fundamental principles of Elixir to build a robust library for writing integration tests with browser automation. I tried to focus on keeping the explanations clear and simple for even beginners to understand!

The post can be found here: https://woojiahao.github.io/blog/posts/2021-01-10-Open-source Deep Dive: Hound

IntelliJ Elixir v11.9.1

Changelog

v11.9.1

Bug Fixes

  • Fix syntax highlighting stopping due to decompiling of Kernel failing caused by bugs introduced in #1834. Syntax highlighting could fail part way through a file when Kernel needed to be decompiled to resolve parts of the syntax. This would lead to the file to be colored above a certain point, but then the default gray after that point.

    • Connect compiled stubs to decompiled source by name/arity. Previously, when the decompiler didn’t use the Docs, it was guaranteed that the PsiCompiled stubs would correlate, in-order, with the decompiled source call definitions, and so mirrors could be set by matching up the list of them in order. Since the Docs doesn’t have to correspond to and doesn’t correspond to the binary precisely for some BEAMs, most importantly, Elixir.Kernel.beam, the PsiCompiled stub and decompiled source is now matched by name and arity. This means some mirrors are missed, but no errors are produced.
    • Allow decompile source to map to entire arity range Since the decompile source from Docs can have default arguments the call definition clauses can have an arity range and not just a fixed arity, so all arities in the range need to be mappable to PsiCompiled functions.
    • Use correct macro for signature from Docs. Ensures that defmacro is used for macros instead of hard-coding def as in #1834.
    • Use ~S””” for docs from Docs chunk. The docs from the Docs chunk may contain interpolation in the code samples or #{ in regex examples, but these should not be treated as an interpolation start as the Docs format does not support interpolation. Anything that looks like interpolation in the docs text was actually escaped in the original docs, so also escape it here by using S”””, which turns off interpolation.
    • Log an error if Code function can’t be matched to decompiled source. Unlike the old InvalidMirrorException, this won’t be an exception and the binary <-> decompile will still work for the other functions/macros in the file, so it will be a more graceful degradation.
  • Fix missed references to DepsWatcher as project component DepsWatcher was converted to a Project Listener in #1844 to support installing the plugin from the Marketplace without reloading, but some references to DepsWatcher were still trying to get its instance for project using project.getComponent(), which would now return null.

  • Target Java 1.8 for JPS compatibility. JPS (JetBrains Project System) is the API used to allow External Builders, like mix to build projects.

  • Fix matching unquote(ATOM) call definitions to compiled function by using the argument tounquote when calculating the name of the call definition clause if possible. Needed to match anonymous function names that are unquoted because they contain / to separate the outer function name from the anonymous function naming convention.

  • Don’t use Docs signature for MacroNameArity that is an operator or unquoted The signatures for operators and unquoted don’t produce valid code that can be parsed.

  • Don’t use signatures for __struct__ functions. The signatures for the __struct__ functions are like %Module{}, but that’s not parseable, so bypass the signatures with a specialized SignatureOverride decompiler that matches the actual code in defstruct.

  • Don’t indent empty lines from Docs for @moduledoc and @doc to match the formatter output.

  • Fix capitalization of Docs @moduledoc @moduleDoc -> @moduledoc

Installation Instructions

A hook for handling very large lists with Phoenix Live View

How to stream very large lists to improve page load & rendering time.

https://alex-min.fr/phoenix-live-view-very-large-list-hook/

Working with decimals in Elixir

A quick guide on decimals in Elixir.

Elixir Wizards S5E7 Jason Axelson on the Elixir Language Server

Latest episode of Elixir Wizards is out today! Check it out here: https://smartlogic.io/podcast/elixir-wizards/s5e7-axelson/

Previous page Next page