Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Spotless plugin #18

Merged
merged 14 commits into from Feb 15, 2024
Merged

Add a Spotless plugin #18

merged 14 commits into from Feb 15, 2024

Conversation

Matyrobbrt
Copy link
Member

@Matyrobbrt Matyrobbrt commented Jan 25, 2024

Adds a net.neoforged.gradleutils.spotless plugin that will configure spotless to use a shared formatter config.

See https://github.com/neoforged/NeoForge/blob/932773f5194811609b03edeaa9b0c0f6a7d3a516/codeformat/formatter-config.xml

@Matyrobbrt Matyrobbrt added the enhancement New feature or request label Jan 25, 2024
build.gradle Outdated Show resolved Hide resolved
build.gradle Outdated Show resolved Hide resolved
build.gradle Outdated Show resolved Hide resolved
src/main/resources/formatter-config.xml Outdated Show resolved Hide resolved
@sciwhiz12 sciwhiz12 changed the title Add a Spotless plguin Add a Spotless plugin Feb 9, 2024
Copy link
Member

@Technici4n Technici4n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usage example is as follows, right?

spotlessUtils.configure spotless
spotless {
    // custom stuff
}

Copy link
Member

@sciwhiz12 sciwhiz12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a bit of polish needed on that README section.

README.md Show resolved Hide resolved
README.md Outdated

The `net.neoforged.gradleutils.spotless` plugin provides integration (a formatter configuration) with Spotless.

This plugin provides a `spotlessUtils` extension which has a `configure` method that can be called with the `spotless` extension to configure Spotless and use the formatter configuration provided by GradleUtils.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provide an example, for clarity.

@marchermans
Copy link
Contributor

Also we should probably make a note here: spotless for Gradle requires the Gradle runtime to be running in java 17

@Matyrobbrt Matyrobbrt merged commit 4fec997 into main Feb 15, 2024
1 check passed
@Matyrobbrt Matyrobbrt deleted the feature/spotless-config branch February 15, 2024 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants