Skip to content

Proposal: Build on RuboCop infrastructure #1512

@mvz

Description

@mvz

This is something I've been thinking about for some time.

There have been quite a few long-standing issues in the tracker that are not about Reek's core functionality. These have to do with configuration, the todo file, and the inability to make Reek process files that do not end in .rb.

In addition, there are quite a few different strategies being used for finding smelly code and we do not have one preferred way.

The rubocop project has done all the work of creating a working config file system with all the features our users have been asking for, a great to do file generation system, and an unneeded suppression detector. In addition, it has a nice system for matching s-expressions with certain patterns, as I mentioned before.

I would like to propose re-using some or all of these features for Reek. This would involve something like:

  • Depend on rubocop
  • Re-use rubocop's configuration loading code to read .reek.yml. This would mean adopting rubocop's file format
  • Eventually port our code smell detectors to use rubocop's node matchers
  • Perhaps port our detectors to be rubocop cops, so they can hook into the unneeded suppression cop system

A more extreme option would be to transform reek into a rubocop plugin (i.e., rubocop-reek), and keep the reek executable as a thin layer over that, just to load the correct configuration.

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions