lucasvegi / Elixir-Refactorings

Catalog of Elixir Refactorings
https://doi.org/10.1109/ICSME58846.2023.00045
MIT License
154 stars 1 forks source link

Credo Static Analysis Checks #1

Open Nezteb opened 11 months ago

Nezteb commented 11 months ago

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!

lucasvegi commented 11 months ago

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.🙂

Nezteb commented 8 months ago

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

lucasvegi commented 8 months ago

@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).

Nezteb commented 8 months ago

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. 😄

lucasvegi commented 8 months ago

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

Amazing!