All Versions
101
Latest Version
Avg Release Cycle
8 days
Latest Release
-

Changelog History
Page 1

  • v1.5.1

    • ๐Ÿ›  Fix bug in diff command when run on a subdirectory of a Git repository
    • ๐Ÿ›  Fix bug in new general param :files when excluding files
  • v1.5.0

    • Credo now requires Elixir 1.7 or newer
    • โ™ป๏ธ Refactor check runner (much faster now for common scenarios)
    • โž• Add param allow_acronyms to check Credo.Check.Readability.FunctionNames
    • โž• Add name of check to message when printing issues with --verbose
    • โž• Add support for "dynamic" tagging for checks via .credo.exs

      # Overwrite all tags for FooCheck {FooCheck, [tags: [:my_tag]]}

      # Add tags for FooCheck {SomeCredoCheck, [tags: [:initial, :my_tag]]}

    Tags can then be used as usual, via the CLI switch --checks-with[out]-tag:

      # Only run checks tagged `:my_tag` during analysis
      $ mix credo --checks-with-tag my_tag
    
      # Exclude all checks tagged `:my_tag` from analysis
      $ mix credo --checks-without-tag my_tag
    

    ๐Ÿ†• New switch to enable file watcher

    You can now ask Credo to re-run on file changes:

      $ mix credo --watch
    

    ๐Ÿ†• New diff command

    You can now ask Credo to only report changes in files that were changed since a given Git ref:

      $ mix credo diff HEAD^
      $ mix credo diff master
    

    ๐Ÿš€ You can, of course, combine this with the new --watch switch to iteratively fix issues that have come up since the last release:

      $ mix credo diff v1.4.0 --watch
    

    ๐Ÿ†• New general check param :files

    You can now include/exclude specific files or patterns for specific checks.

    The syntax is the same as for the top-level :files key:

  • v1.4.0

    April 19, 2020
    • ๐Ÿš€ Credo's schema for pre-release names changes: There is now a . after the rc like in many other Elixir projects.

    • โž• Add support for explaining checks (in addition to issues), i.e.

      $ mix credo explain Credo.Check.Design.AliasUsage

    • โž• Add support for tags on checks

    Checks can now declare tags via the __using__ macro, i.e.

      defmodule MyCheck do
        use Credo.Check, tags: [:foo]
    
        def run(%SourceFile{} = source_file, params) do
          #
        end
      end
    

    Tags can be used via the CLI switch --checks-with[out]-tag:

      # Only run checks tagged `:foo` during analysis
      $ mix credo --checks-with-tag foo
    
      # Exclude all checks tagged `:foo` from analysis
      $ mix credo --checks-without-tag foo
    
    • โž• Add validation of check params in config

    If a param is not found, Credo checks for mispellings and suggests corrections:

      $ mix credo
      ** (config) Credo.Check.Design.AliasUsage: unknown param `fi_called_more_often_than`. Did you mean `if_called_more_often_than`?
    
    • โž• Add auto-generated check docs
    • โž• Add new documentation on Hex with extra guides and CHANGELOG
  • v1.4.0-rc.2

    April 10, 2020
  • v1.4.0-rc.1

    April 02, 2020
    • ๐Ÿš€ Credo's schema for pre-release names changes: There is now a . after the rc like in many other Elixir projects.

    • โž• Add support for explaining checks (in addition to issues), i.e.

      $ mix credo explain Credo.Check.Design.AliasUsage

    • โž• Add support for tags on checks

    Checks can now declare tags via the __using__ macro, i.e.

      defmodule MyCheck do
        use Credo.Check, tags: [:foo]
    
        def run(source_file, params) do
          #
        end
      end
    

    Tags can be used via the CLI switch --checks-with[out]-tag:

      # Only run checks tagged `:foo` during analysis
      $ mix credo --checks-with-tag foo
    
      # Exclude all checks tagged `:foo` from analysis
      $ mix credo --checks-without-tag foo
    
    • โž• Add validation of check params in config

    If a param is not found, Credo checks for mispellings and suggests corrections:

      $ mix credo
      ** (config) Credo.Check.Design.AliasUsage: unknown param `fi_called_more_often_than`. Did you mean `if_called_more_often_than`?
    
    • โž• Add auto-generated check docs
    • โž• Add new documentation on Hex with extra guides and CHANGELOG
  • v1.3.2

    March 27, 2020
    • ๐Ÿ‘Œ Support non-ascii characters in variable names
    • ๐Ÿ›  Fix false positive in Credo.Check.Readability.ParenthesesOnZeroArityDefs
  • v1.3.1

    March 14, 2020
    • ๐Ÿ›  Fix new check (Credo.Check.Readability.StrictModuleLayout)
    • Ignore module attributes in UnsafeToAtom
  • v1.3.0

    March 09, 2020
    • 0๏ธโƒฃ Enable Credo.Check.Readability.UnnecessaryAliasExpansion check by default
    • ๐Ÿ›  Fix bugs when removing heredocs and charlists from sources
    • ๐Ÿ›  Fix false positive on TrailingWhiteSpace
    • โž• Add ignore: [:fun1, :fun2] param to all UnusedOperation* checks; to ignore unused Enum.reduce/3 operations, use

      {Credo.Check.Warning.UnusedEnumOperation, [ignore: [:reduce]]},

    ๐Ÿ†• New switch to re-enable disabled checks

    ๐Ÿ‘‰ Use --enable-disabled-checks [pattern] to re-enable checks that were disabled in the config using {CheckModule, false}. This comes in handy when using checks on a case-by-case basis

    As with other check-related switches, pattern is a comma-delimted list of patterns:

    $ mix credo info --enable-disabled-checks Credo.Check.Readability.Specs,Credo.Check.Refactor.DoubleBooleanNegation
    

    Of course, we can have the same effect by choosing the pattern less explicitly:

    $ mix credo info --enable-disabled-checks specs,double
    

    ๐Ÿ†• New API for custom checks

    ๐Ÿ—„ > This deprecates the mandatory use of @explanation and @default_params module attributes for checks.

    0๏ธโƒฃ Before v1.3 you had to define module attributes named @explanation and @default_params before calling use Credo.Check.

    0๏ธโƒฃ Now you can pass :explanations (plural) and :param_defaults options directly to use Credo.Check.

    defmodule MyCheck do
      use Credo.Check,
        category: :warning,
        base_priority: :high,
        param_defaults: [param1: 42, param2: "offline"],
        explanations: [
          check: "...",
          params: [
            param1: "Your favorite number",
            param2: "Online/Offline mode"
          ]
        ]
    
      def run(%SourceFile{} = source_file, params) do
        #
      end
    end
    

    Please note that these options are also just a convenience to implement the functions specified by the Credo.Check behaviour. You can alternatively implement the respective functions yourself:

    defmodule MyCheck do
      use Credo.Check
    
      def category, do: :warning
    
      def base_priority, do: :high
    
      def explanations do
        [
          check: "...",
          params: [
            param1: "Your favorite number",
            param2: "Online/Offline mode"
          ]
        ]
      end
    
      def param_defaults, do: [param1: 42, param2: "offline"]
    
      def run(%SourceFile{} = source_file, params) do
        #
      end
    end
    

    ๐Ÿ†• New checks

    • Credo.Check.Readability.StrictModuleLayout
    • Credo.Check.Readability.WithCustomTaggedTuple
    • โš  Credo.Check.Warning.LeakyEnvironment
    • โš  Credo.Check.Warning.UnsafeExec
  • v1.3.0-rc3

    March 01, 2020
  • v1.3.0-rc2

    February 25, 2020