credo v0.8.0 Release Notes

    • Load source files in parallel
    • ๐Ÿ‘Œ Improve high memory consumption
    • ๐Ÿ›  Fix comment handling of Charlists, Sigils and Strings
    • 0๏ธโƒฃ LazyLogging now only checks for debug calls by default
    • โž• Add --mute-exit-status CLI switch, which mutes Credo's exit status (this will be used for integration tests as it means that any non-zero exit status results from a runtime error of Credo)
    • โž• Add default param values to mix explain output
    • TagTODO and TagFIXME now also report tags from doc-related module attributes (@doc, @moduledoc, @shortdoc)
    • ๐Ÿ›  Fix false positives for TrailingWhiteSpace
    • ๐Ÿ›  Fix compiler warnings for Sigils

    ๐Ÿ’ฅ BREAKING CHANGES

    These changes concern people writing their own checks for Credo.

    • ๐Ÿ”จ Credo.SourceFile struct was refactored: source, lines and ast are now stored in ETS tables.
    • Credo.Config struct was replaced by Credo.Execution.
    • run/3 callbacks for Credo.Check are now run/4 callbacks as they have to receive the execution's Credo.Execution struct.

    ๐Ÿ‘• Config Comments replace @lint attributes

    ๐Ÿ‘• @lint attributes are deprecated and will be removed in Credo 0.9.0 because โš  they are causing a compiler warning in Elixir >= 1.4.

    ๐Ÿ‘‰ Users of Credo can now disable individual lines or files for all or just specific checks.

    For now, config comments let you exclude individual files completely

    # credo:disable-for-this-file
    defmodule SomeApp.ThirdPartyCode do
    end
    

    or deactivate specific lines:

    def my_fun do
      # credo:disable-for-next-line
      IO.inspect :this_is_actually_okay
    end
    

    or add the check module to exclude just that one check:

    def my_fun do
      # credo:disable-for-next-line Credo.Check.Warning.IoInspect
      IO.inspect :this_is_actually_okay
    end
    

    or use a Regex to be more flexible which checks to exclude:

    def my_fun do
      # credo:disable-for-next-line /IoInspect/
      IO.inspect :this_is_actually_okay
    end
    

    Here's a list with the syntax options:

    • # credo:disable-for-this-file - to disable for the entire file
    • # credo:disable-for-next-line - to disable for the next line
    • # credo:disable-for-previous-line - to disable for the previous line
    • # credo:disable-for-lines:<count> - to disable for the given number of lines (negative for previous lines)

    ๐Ÿ†• New checks

    • ๐Ÿ”จ Credo.Check.Refactor.LongQuoteBlocks