openrewrite / openrewrite/rewrite

`ECMAScript6BestPractices` endless comment copy bug.

Open
#6,330 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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?

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.