Skip to content

Commit

Permalink
Enforce additional best practices (#97)
Browse files Browse the repository at this point in the history
* Enforce additional best practices

* Apply suggestions from code review

* Run recipes with Java 17 by default

* Also remove extra semicolons seen twice
  • Loading branch information
timtebeek authored Sep 17, 2024
1 parent edcb385 commit fd7d1ca
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion .github/workflows/pr-run-recipes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ name: pr-run-recipes
on:
workflow_call:
inputs:
java_version:
description: What version of Java to use
type: number
default: 17
required: false
recipe:
description: The OpenRewrite recipe to apply to the PR
type: string
Expand All @@ -21,6 +26,28 @@ on:
description: Applies best practices for Moderne Inc. SaaS repositories.
recipeList:
- org.openrewrite.java.testing.assertj.Assertj
- org.openrewrite.java.testing.cleanup.RemoveTestPrefix
- org.openrewrite.java.logging.slf4j.Slf4jBestPractices
- org.openrewrite.java.OrderImports:
removeUnused: true
- org.openrewrite.staticanalysis.RemoveExtraSemicolons
- io.moderne.NullabilityBestPractices
---
type: specs.openrewrite.org/v1beta/recipe
name: io.moderne.NullabilityBestPractices
displayName: Nullability best practices
description: Use JSpecify nullable annotations; drop Nonnull annotations; use `NullMarked` on `package-info.java` instead.
recipeList:
- org.openrewrite.java.jspecify.MigrateFromOpenRewriteAnnotations
- org.openrewrite.staticanalysis.NullableOnMethodReturnType
- org.openrewrite.java.RemoveAnnotation:
annotationPattern: '@org.jetbrains.annotations.NotNull'
- org.openrewrite.java.RemoveAnnotation:
annotationPattern: '@javax.annotation.Nonnull'
- org.openrewrite.java.RemoveAnnotation:
annotationPattern: '@jakarta.annotation.Nonnull'
- org.openrewrite.java.jspecify.MigrateToJspecify
init_gradle:
description: The Gradle init script to apply to the PR
type: string
Expand Down Expand Up @@ -74,7 +101,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
java-version: ${{ inputs.java_version }}

# Capture the PR number
- name: Create pr_number.txt
Expand Down

0 comments on commit fd7d1ca

Please sign in to comment.