-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrewrite.yml
More file actions
38 lines (38 loc) · 2.58 KB
/
rewrite.yml
File metadata and controls
38 lines (38 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# my-pdf-tools-java' curated OpenRewrite pass — the union of the former per-app recipes (register and
# despeckle shipped identical lists; tate-yoko-pdf configured its recipes inline). Run on demand:
# ./gradlew rewriteDryRun (preview the patch; `just rewrite-check`)
# ./gradlew rewriteRun (apply; `just rewrite` also runs spotlessApply)
#
# Deliberately NOT wired into `build` (see build.gradle.kts): a recipe never blocks a commit.
# Formatting is owned by Spotless/google-java-format, so no OpenRewrite formatting recipe appears
# here — CodeCleanup is deliberately NOT included because it bundles layout recipes
# (NoWhitespaceAfter, OrderImports, ShortenFullyQualifiedTypeReferences, ...) that fight
# google-java-format, plus HideUtilityClassConstructor, which misfires on all-static test classes and
# is a semantic edit spotlessApply cannot undo. Nullability is owned by JSpecify + NullAway, so no
# annotate-nullable recipe appears here either. var-introduction and FinalizeLocalVariables are
# excluded to respect the explicit-type, non-final-locals house style. We pick ParameterizedLogging
# over the full Slf4jBestPractices, whose WrapExpensiveLogStatementsInConditionals rewrites
# already-clean parameterized calls into the verbose fluent builder.
#
# Applied at the monorepo root, this single recipe visits the source sets of every subproject across
# all three apps (register, despeckle, tate-yoko-pdf).
type: specs.openrewrite.org/v1beta/recipe
name: io.github.p4suta.CuratedCleanup
displayName: my-pdf-tools-java curated cleanup
description: >-
JUnit 5 conventions, parameterized SLF4J logging, security checks, and a JDK-25
modernization pass. Excludes anything that fights Spotless (formatting),
NullAway/JSpecify (nullability annotations), or the explicit-type / non-final-locals
house style.
recipeList:
# CommonStaticAnalysis is temporarily dropped: its MinimumSwitchCases recipe throws
# IndexOutOfBoundsException (J$Case.getPattern) on the pattern-matching switches this
# codebase uses (`case PagePairSpec.Pair pair -> …`), which aborts the whole rewriteDryRun.
# The bug is present through the latest OpenRewrite (rewrite-recipe-bom 3.32.0). Re-add the
# line below once a newer recipe BOM fixes it (Dependabot tracks the bump).
# - org.openrewrite.staticanalysis.CommonStaticAnalysis
- org.openrewrite.java.testing.junit5.JUnit5BestPractices
- org.openrewrite.java.testing.cleanup.AssertionsArgumentOrder
- org.openrewrite.java.logging.slf4j.ParameterizedLogging
- org.openrewrite.java.security.JavaSecurityBestPractices
- org.openrewrite.java.migrate.UpgradeToJava25