Customizing Credo for Enhanced Code Analysis in Elixir

201
clicks
Customizing Credo for Enhanced Code Analysis in Elixir

Source: elixir.courses

Type: Post

The author of the article emphasizes the importance of setting up a static analysis stack when starting a new Phoenix project, which includes tools like Credo, Dialyzer/Dialyxir, Sobelow, and mix format. The author suggests that Credo's default settings may not be ideal and recommends enabling strict mode while disabling specific rules that are not useful. For instance, the author turns off the Credo.Check.Readability.AliasOrder and Credo.Check.Design.TagTODO rules but enables others, such as the Credo.Check.Warning.MixEnv and Credo.Check.Refactor.PassAsyncInTestCases. They also mention some controversial low-priority rules like Credo.Check.Readability.StrictModuleLayout. The article provides a sample configuration that the author uses, which includes a mix of enabled and disabled checks, along with some that they remain undecided on. The author calls this a 'living document' and plans to update it as their preferences evolve.

© HashMerge 2024