Generate `# credo:disable*` comments and find unneeded ones
Nobody has claimed this yet.
- Dominant language
- Elixir
- Stars
- 5.2k
- Forks
- 457
- Avg merge
- 6h 2m
- Merged PRs (30d)
- 1
Description
Hi,
I'm introducing Credo in a fairly large project. As a starting point to get us going, I ignore a lot of Credo issues with one of the inline config comments. I generated those with the help of Claude Code. It's somewhat slow, but it works well most of the time. It did happen though that some of the comments it generated were wrong. I had to manually review a lot of files to ensure no comment is superfluous.
So with this in mind, it got me thinking. Would it be possible for Credo to generate those # credo:disable* comments?
I worked a lot with Ruby and this reminds me of RuboCop, a linter for Ruby. It has this feature where you generate the RuboCop configuration and it automatically ignores all offenses it finds. This is a great developer experience and it's super easy to get started this way. Here's a quote from RuboCop's docs on that feature:
If you have a code base with an overwhelming amount of offenses, it can be a good idea to use rubocop --auto-gen-config, which creates .rubocop_todo.yml and adds inherit_from: .rubocop_todo.yml in your .rubocop.yml. The generated file .rubocop_todo.yml contains configuration to disable cops that currently detect an offense in the code by changing the configuration for the cop, excluding the offending files, or disabling the cop altogether once a file count limit has been reached.
As for finding unneeded # credo:disable* comments, I have to make another parallel to RuboCop... sorry I worked in Ruby for many years. It has this nice check where it detects unneeded disable comments. Is this possible in Credo? I haven't found something about this.
Sorry for the wall of text, let me know if I wasn't clear.
Thank you for your work on Credo.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing Credo's inline config comments documentation and the existing analysis and reporting entry points; the issue names no source files or tests. Define the scope for generating # credo:disable* comments and detecting redundant ones, then establish tests showing generated comments suppress current offenses without adding unnecessary disables.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elixir
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100