Elixir-Refactorings icon indicating copy to clipboard operation
Elixir-Refactorings copied to clipboard

Credo Static Analysis Checks

Open Nezteb opened this issue 2 years ago • 5 comments

I think it'd be amazing to have some of your refactorings implemented as Credo static analysis checks. They don't necessarily need to be merged into credo upstream either, as Credo supports custom checks.

Here is my proposal to the Credo project.

I was excited to learn about this project; fantastic work!

Nezteb avatar Oct 09 '23 17:10 Nezteb

I think it'd be amazing to have some of your refactorings implemented as Credo static analysis checks. They don't necessarily need to be merged into credo upstream either, as Credo supports custom checks.

Here is my proposal to the Credo project.

I was excited to learn about this project; fantastic work!

@Nezteb Although we haven't yet provided any automated tools for checking both our code smells and our refactorings, we do intend to have some form of automation for detecting code smells/refactoring opportunities at some point. In this regard, I believe an adaptation of Credo could be a promising approach.

Thank you very much for the suggestion and for recommending our work in the Credo repository! Feel free to send us improvement suggestions for our refactoring catalog, as well as assist us in its promotion.🙂

lucasvegi avatar Oct 10 '23 01:10 lucasvegi

@lucasvegi Is there a plan for this? Or should we consider this "out of scope" for this repo? 😄

Nezteb avatar Dec 28 '23 19:12 Nezteb

@lucasvegi Is there a plan for this? Or should we consider this "out of scope" for this repo? 😄

Hello my friend, to be very honest, although we believe that the tools to automate the use of these refactorings are extremely important, we do not intend to develop them in the short/medium term.

This repo is part of my PhD thesis (where we are cataloging refactorings and smells) and we still have a series of other priorities to work on/validate before we develop or adapt any tool like Credo. 

Anyway, it would be really cool to see someone in the Elixir community working in parallel to develop a tool that automates the detection of opportunities or even the application of the refactorings we are researching. The same goes for our code smells. 🙂

I believe this could be done in the respective refactoring and smells repositories via pull request, or even in a specific repository for the tool (linking it with the catalogs' repositories).

lucasvegi avatar Dec 28 '23 20:12 lucasvegi

Actually I think you're right and we could probably move the implementation conversations to https://github.com/rrrene/credo-proposals/issues/91.

I've not written a custom Credo check before, so I'll have to familiarize myself with its use.

Before attempting to implement anything, I've started a spreadsheet to take care of matching each refactoring to an associated Credo check. 😄

Nezteb avatar Dec 28 '23 22:12 Nezteb

Before attempting to implement anything, I've started a spreadsheet to take care of matching each refactoring to an associated Credo check. 😄

Amazing!

lucasvegi avatar Dec 31 '23 15:12 lucasvegi