/
static-analysis.yml
82 lines (82 loc) · 3.69 KB
/
static-analysis.yml
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#
# Copyright 2021 the original author or authors.
# <p>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# <p>
# https://www.apache.org/licenses/LICENSE-2.0
# <p>
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.staticanalysis.CodeCleanup
displayName: Code cleanup
description: Automatically cleanup code, e.g. remove unnecessary parentheses, simplify expressions.
recipeList:
- org.openrewrite.staticanalysis.DefaultComesLast
- org.openrewrite.staticanalysis.EmptyBlock
- org.openrewrite.java.format.EmptyNewlineAtEndOfFile
- org.openrewrite.staticanalysis.ForLoopControlVariablePostfixOperators
- org.openrewrite.staticanalysis.FinalizePrivateFields
- org.openrewrite.java.format.MethodParamPad
- org.openrewrite.java.format.NoWhitespaceAfter
- org.openrewrite.java.format.NoWhitespaceBefore
- org.openrewrite.java.format.PadEmptyForLoopComponents
- org.openrewrite.staticanalysis.TypecastParenPad
- org.openrewrite.staticanalysis.EqualsAvoidsNull
- org.openrewrite.staticanalysis.ExplicitInitialization
- org.openrewrite.staticanalysis.FallThrough
- org.openrewrite.staticanalysis.HideUtilityClassConstructor
- org.openrewrite.staticanalysis.NeedBraces
- org.openrewrite.staticanalysis.OperatorWrap
- org.openrewrite.staticanalysis.UnnecessaryParentheses
- org.openrewrite.staticanalysis.ReplaceThreadRunWithThreadStart
- org.openrewrite.staticanalysis.ChainStringBuilderAppendCalls
- org.openrewrite.staticanalysis.ReplaceStringBuilderWithString
- org.openrewrite.java.ShortenFullyQualifiedTypeReferences
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.staticanalysis.ReplaceThreadRunWithThreadStart
displayName: "Replace calls to `Thread.run()` with `Thread.start()`"
description: "`Thread.run()` should not be called directly."
recipeList:
- org.openrewrite.java.ChangeMethodName:
methodPattern: java.lang.Thread run()
newMethodName: start
tags:
- RSPEC-S1217
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.staticanalysis.CommonDeclarationSiteTypeVariances
displayName: "Properly use declaration-site type variance for well-known types"
description: "When using a method parameter like `Function<IN, OUT>`, it should rather be `Function<? super IN, ? extends OUT>`. This recipe checks for method parameters of well-known types."
recipeList:
- org.openrewrite.staticanalysis.DeclarationSiteTypeVariance:
variantTypes:
- java.util.function.Consumer<IN>
- java.util.function.BiPredicate<IN, IN>
- java.util.function.DoubleFunction<OUT>
- java.util.function.Function<IN, OUT>
- java.util.function.IntFunction<OUT>
- java.util.function.LongFunction<OUT>
- java.util.function.ObjDoubleConsumer<IN>
- java.util.function.ObjIntConsumer<IN>
- java.util.function.ObjLongConsumer<IN>
- java.util.function.Predicate<IN>
- java.util.function.Supplier<OUT>
- java.util.function.ToDoubleBiFunction<IN, IN>
- java.util.function.ToDoubleFunction<IN>
- java.util.function.ToIntBiFunction<IN, IN>
- java.util.function.ToIntFunction<IN>
- java.util.function.ToLongBiFunction<IN, IN>
- java.util.function.ToLongFunction<IN>
excludeBounds:
- java.lang.*
tags:
- RSPEC-S1217