rrrene / credo-proposals

Proposals for Credo, the Elixir code analysis tool with a focus on code consistency and teaching
MIT License
9 stars 0 forks source link

New Checks: "Towards a Catalog of Refactorings for Elixir" #91

Open Nezteb opened 1 year ago

Nezteb commented 1 year ago

What do you want Credo to do?

See @lucasvegi's work and accompanying research paper.

It's a carefully curated collection of 54 good Elixir refactoring opportunities, and I think many of them would make good credo checks.

I mentioned this in their repo as well.

Which existing behaviour would change?

This would add new checks that credo users could opt-in to.

lucasvegi commented 1 year ago

I completely agree with the suggestion! We actually plan to automate checks for our catalogs of Code Smells and Refactorings at some point in the future, and Credo could be an excellent alternative for that.

rrrene commented 1 year ago

I am sympathetic to this as well. We could include the checks directly in Credo an give them a special tag or, if you want to remain in control of the checks' code, we could provide a plugin that includes those checks.

lucasvegi commented 1 year ago

I am sympathetic to this as well. We could include the checks directly in Credo an give them a special tag or, if you want to remain in control of the checks' code, we could provide a plugin that includes those checks.

Amazing! It would be exciting to have our research incorporated into Credo. Suddenly not only the refactorings part, but also the code smells part which is being incorporated into the Elixir official documentation. As for the incorporation strategy (directly or via plugin), honestly, I still don't have an opinion on which would be best.