Skip to content

GitHub Action that translates spotless apply diff into GitHub pull request code suggestion comments #1704

Open

Description

@nedtwigg

Discussed in #1700

Spotless GitHub Action developed & applied which takes the diff as created through spotless:apply and uses for instance googleapis/code-suggester to create code suggestion comments on the pull request.

This is similar to

but that issue is blocked on a few internal enhancements to Spotless. This issue uses spotlessApply to change the files in the working copy, and then generate PR change suggestions from those changes in the working copy. That simplifies the implementation quite a bit, and should be workable with even very old versions of Spotless.

Happy to take a PR for this.

Activity

  1. timtebeek commented on Nov 26, 2023

    @timtebeek

    Finally found some time to play around with code-suggester; here's a demo application that runs ./gradlew licenseFormat.
    When a pull request is opened where that command produces a diff, then the changes are properly suggested on the PR, as seen on timtebeek/code-suggester-action-reproducer#1

    I haven't yet worked out what would be needed to gracefully wrap this up as a Spotless GitHub Action, but anyone with more knowledge there is welcome to pitch in. Ideally this makes it as easy as possible to hook into a repository & correct formatting on contributions.

  2. nedtwigg commented on Nov 27, 2023

    @nedtwigg
    MemberAuthor

    Very cool progress!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions