openrewrite / openrewrite/rewrite

Option to enable recipes to leave a comment indicating auto-generated code

Open
#4,086 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
3.7k
Forks
570
Avg merge
13h 12m
Merged PRs (30d)
261

Description

What problem are you trying to solve?

After running several recipes against their code, some users may have difficulty distinguishing between what is theirs and what isn't. Also, in the event that a recipe causes some unexpected issues, users executing several recipes against their code will likely have trouble identifying which recipe was the source of the issue.

Describe the solution you'd like

Having a built-in option users could enable when executing rewrite-run that fingerprints each line of code modified by a recipe would help solve these problems. This fingerprint would be a comment indicating that the lines of code were autogenerated and what recipe generated the code.

Have you considered any alternatives or workarounds?

Additional context

Are you interested in contributing this feature to OpenRewrite?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the rewrite-run execution path and how recipes report code changes. The work is done when an opt-in setting fingerprints modified lines with comments identifying generated code and the recipe that produced it, including a way to verify the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.