openrewrite / openrewrite/rewrite
`ECMAScript6BestPractices` endless comment copy bug.
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3.7k
- Forks
- 570
- Avg merge
- 13h 12m
- Merged PRs (30d)
- 261
Description
What version of OpenRewrite are you using?
I am using
- OpenRewrite v1.2.3
- Maven/Gradle plugin v1.2.3
- rewrite-module v1.2.3
How are you running OpenRewrite?
I am using the Maven plugin, and my project is a single module project.
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>6.24.0</version>
<configuration>
<exportDatatables>true</exportDatatables>
<skipMavenParsing>true</skipMavenParsing>
<activeRecipes>
<recipe>org.checkstyle.openrewrite.SanityCheck</recipe>
</activeRecipes>
<exclusions>
<exclusion>**.ci-temp**</exclusion>
<exclusion>**.jp*g</exclusion>
<exclusion>**.png</exclusion>
<exclusion>**/resources-noncompilable</exclusion>
<exclusion>**src/it/resources**</exclusion>
<exclusion>**src/test/resources**</exclusion>
<exclusion>**xdocs-examples**</exclusion>
</exclusions>
<plainTextMasks>
<plainTextMask>**.groovy</plainTextMask>
<plainTextMask>**.xml</plainTextMask>
<plainTextMask>**.yml</plainTextMask>
<plainTextMask>**/resources-noncompilable/**</plainTextMask>
<plainTextMask>**/resources/**</plainTextMask>
</plainTextMasks>
</configuration>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle-openrewrite-recipes</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-migrate-java</artifactId>
<version>3.22.0</version>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-codemods</artifactId>
<version>0.22.0</version>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-static-analysis</artifactId>
<version>2.22.0</version>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-rewrite</artifactId>
<version>0.16.0</version>
</dependency>
</dependencies>
</plugin>
What is the smallest, simplest way to reproduce the problem?
-
https://github.com/diffplug/spotless/pull/2768#discussion_r2555671425
-
https://github.com/checkstyle/checkstyle/pull/18158/files#r2555889770
What did you expect to see?
// this file will be glued to the top of the specific xy-serve.js file
const debug_serve = false; // set to true for debug log output in node process
const shutdownServer = require("http-graceful-shutdown");
const express = require("express");
What did you see instead?
happens only in/after second run:
first time it was fast and fine best second time freezed everything.
endless copying the comment every run:
// this file will be glued to the top of the specific xy-serve.js file
// this file will be glued to the top of the specific xy-serve.js file
// this file will be glued to the top of the specific xy-serve.js file
// this file will be glued to the top of the specific xy-serve.js file
// this file will be glued to the top of the specific xy-serve.js file
const debug_serve = false; // set to true for debug log output in node process
const shutdownServer = require("http-graceful-shutdown");
const express = require("express");
What is the full stack trace of any errors you encountered?
stacktrace output here
Are you interested in contributing a fix to OpenRewrite?
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 the linked Spotless and Checkstyle discussions and locating the ECMAScript6BestPractices recipe or its execution entry point. Reproduce the Maven-plugin run twice and verify that the header comment is not duplicated on subsequent runs; the issue provides no test or source file path to start from.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100