diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AmbiguousJsonCreator.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AmbiguousJsonCreator.java index 9a031a9f05f..4b607640cd5 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AmbiguousJsonCreator.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AmbiguousJsonCreator.java @@ -4,6 +4,7 @@ import static com.google.errorprone.BugPattern.SeverityLevel.WARNING; import static com.google.errorprone.BugPattern.StandardTags.LIKELY_ERROR; import static com.google.errorprone.matchers.Matchers.isType; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; @@ -26,7 +27,7 @@ @AutoService(BugChecker.class) @BugPattern( summary = "`JsonCreator.Mode` should be set for single-argument creators", - link = "https://error-prone.picnic.tech/bugpatterns/AmbiguousJsonCreator", + link = BASE_URL_BUGPATTERNS + "AmbiguousJsonCreator", linkType = CUSTOM, severity = WARNING, tags = LIKELY_ERROR) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AssertJIsNull.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AssertJIsNull.java index 9964b7c5ef3..4e009937571 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AssertJIsNull.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AssertJIsNull.java @@ -8,6 +8,7 @@ import static com.google.errorprone.matchers.Matchers.argumentCount; import static com.google.errorprone.matchers.Matchers.instanceMethod; import static com.google.errorprone.matchers.Matchers.nullLiteral; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; @@ -31,7 +32,7 @@ @AutoService(BugChecker.class) @BugPattern( summary = "Prefer `.isNull()` over `.isEqualTo(null)`", - link = "https://error-prone.picnic.tech/bugpatterns/AssertJIsNull", + link = BASE_URL_BUGPATTERNS + "AssertJIsNull", linkType = CUSTOM, severity = SUGGESTION, tags = SIMPLIFICATION) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AutowiredConstructor.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AutowiredConstructor.java index b3df93703c1..dd91960e390 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AutowiredConstructor.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/AutowiredConstructor.java @@ -6,6 +6,7 @@ import static com.google.errorprone.matchers.ChildMultiMatcher.MatchType.AT_LEAST_ONE; import static com.google.errorprone.matchers.Matchers.annotations; import static com.google.errorprone.matchers.Matchers.isType; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.common.collect.ImmutableList; @@ -28,7 +29,7 @@ @AutoService(BugChecker.class) @BugPattern( summary = "Omit `@Autowired` on a class' sole constructor, as it is redundant", - link = "https://error-prone.picnic.tech/bugpatterns/AutowiredConstructor", + link = BASE_URL_BUGPATTERNS + "AutowiredConstructor", linkType = CUSTOM, severity = SUGGESTION, tags = SIMPLIFICATION) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/CanonicalAnnotationSyntax.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/CanonicalAnnotationSyntax.java index afd7202713b..1fcec690229 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/CanonicalAnnotationSyntax.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/CanonicalAnnotationSyntax.java @@ -3,6 +3,7 @@ import static com.google.errorprone.BugPattern.LinkType.CUSTOM; import static com.google.errorprone.BugPattern.SeverityLevel.SUGGESTION; import static com.google.errorprone.BugPattern.StandardTags.SIMPLIFICATION; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.common.collect.ImmutableSet; @@ -31,7 +32,7 @@ @AutoService(BugChecker.class) @BugPattern( summary = "Omit redundant syntax from annotation declarations", - link = "https://error-prone.picnic.tech/bugpatterns/CanonicalAnnotationSyntax", + link = BASE_URL_BUGPATTERNS + "CanonicalAnnotationSyntax", linkType = CUSTOM, severity = SUGGESTION, tags = SIMPLIFICATION) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/CollectorMutability.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/CollectorMutability.java index 13047023dbc..31740c3e8b6 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/CollectorMutability.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/CollectorMutability.java @@ -4,6 +4,7 @@ import static com.google.errorprone.BugPattern.SeverityLevel.WARNING; import static com.google.errorprone.BugPattern.StandardTags.FRAGILE_CODE; import static com.google.errorprone.matchers.method.MethodMatchers.staticMethod; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; @@ -29,7 +30,7 @@ @BugPattern( summary = "Avoid `Collectors.to{List,Map,Set}` in favour of alternatives that emphasize (im)mutability", - link = "https://error-prone.picnic.tech/bugpatterns/CollectorMutability", + link = BASE_URL_BUGPATTERNS + "CollectorMutability", linkType = CUSTOM, severity = WARNING, tags = FRAGILE_CODE) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/EmptyMethod.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/EmptyMethod.java index 356860bea7d..b9fff6b2c90 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/EmptyMethod.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/EmptyMethod.java @@ -7,6 +7,7 @@ import static com.google.errorprone.matchers.Matchers.annotations; import static com.google.errorprone.matchers.Matchers.anyOf; import static com.google.errorprone.matchers.Matchers.isType; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; @@ -26,7 +27,7 @@ @AutoService(BugChecker.class) @BugPattern( summary = "Empty method can likely be deleted", - link = "https://error-prone.picnic.tech/bugpatterns/EmptyMethod", + link = BASE_URL_BUGPATTERNS + "EmptyMethod", linkType = CUSTOM, severity = SUGGESTION, tags = SIMPLIFICATION) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ErrorProneTestHelperSourceFormat.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ErrorProneTestHelperSourceFormat.java index 5c3ac77118b..bb3934077a3 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ErrorProneTestHelperSourceFormat.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ErrorProneTestHelperSourceFormat.java @@ -6,6 +6,7 @@ import static com.google.errorprone.matchers.Matchers.anyOf; import static com.google.errorprone.matchers.Matchers.instanceMethod; import static java.util.stream.Collectors.joining; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.common.base.Splitter; @@ -50,7 +51,7 @@ @AutoService(BugChecker.class) @BugPattern( summary = "Test code should follow the Google Java style", - link = "https://error-prone.picnic.tech/bugpatterns/ErrorProneTestHelperSourceFormat", + link = BASE_URL_BUGPATTERNS + "ErrorProneTestHelperSourceFormat", linkType = CUSTOM, severity = SUGGESTION, tags = STYLE) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ExplicitEnumOrdering.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ExplicitEnumOrdering.java index b518e54f371..82a09e78975 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ExplicitEnumOrdering.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ExplicitEnumOrdering.java @@ -7,6 +7,7 @@ import static com.google.errorprone.BugPattern.StandardTags.FRAGILE_CODE; import static com.google.errorprone.matchers.method.MethodMatchers.staticMethod; import static java.util.stream.Collectors.collectingAndThen; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.common.collect.ImmutableSet; @@ -36,7 +37,7 @@ @AutoService(BugChecker.class) @BugPattern( summary = "Make sure `Ordering#explicit` lists all of an enum's values", - link = "https://error-prone.picnic.tech/bugpatterns/ExplicitEnumOrdering", + link = BASE_URL_BUGPATTERNS + "ExplicitEnumOrdering", linkType = CUSTOM, severity = WARNING, tags = FRAGILE_CODE) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/FluxFlatMapUsage.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/FluxFlatMapUsage.java index 03d76496fbe..73528513a7b 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/FluxFlatMapUsage.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/FluxFlatMapUsage.java @@ -4,6 +4,7 @@ import static com.google.errorprone.BugPattern.SeverityLevel.ERROR; import static com.google.errorprone.BugPattern.StandardTags.LIKELY_ERROR; import static com.google.errorprone.matchers.method.MethodMatchers.instanceMethod; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.common.collect.Iterables; @@ -43,7 +44,7 @@ summary = "`Flux#flatMap` and `Flux#flatMapSequential` have subtle semantics; " + "please use `Flux#concatMap` or explicitly specify the desired amount of concurrency", - link = "https://error-prone.picnic.tech/bugpatterns/FluxFlatMapUsage", + link = BASE_URL_BUGPATTERNS + "FluxFlatMapUsage", linkType = CUSTOM, severity = ERROR, tags = LIKELY_ERROR) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/FormatStringConcatenation.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/FormatStringConcatenation.java index 269883244df..fc90ef8fbaa 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/FormatStringConcatenation.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/FormatStringConcatenation.java @@ -10,6 +10,7 @@ import static com.google.errorprone.matchers.Matchers.not; import static com.google.errorprone.matchers.Matchers.staticMethod; import static java.util.stream.Collectors.joining; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; @@ -51,7 +52,7 @@ @AutoService(BugChecker.class) @BugPattern( summary = "Defer string concatenation to the invoked method", - link = "https://error-prone.picnic.tech/bugpatterns/FormatStringConcatenation", + link = BASE_URL_BUGPATTERNS + "FormatStringConcatenation", linkType = CUSTOM, severity = WARNING, tags = SIMPLIFICATION) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/IdentityConversion.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/IdentityConversion.java index 569d8340ebd..688d46b615b 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/IdentityConversion.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/IdentityConversion.java @@ -7,6 +7,7 @@ import static com.google.errorprone.matchers.Matchers.anyOf; import static com.google.errorprone.matchers.Matchers.staticMethod; import static com.google.errorprone.suppliers.Suppliers.OBJECT_TYPE; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.common.primitives.Primitives; @@ -36,7 +37,7 @@ @AutoService(BugChecker.class) @BugPattern( summary = "Avoid or clarify identity conversions", - link = "https://error-prone.picnic.tech/bugpatterns/IdentityConversion", + link = BASE_URL_BUGPATTERNS + "IdentityConversion", linkType = CUSTOM, severity = WARNING, tags = SIMPLIFICATION) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ImmutablesSortedSetComparator.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ImmutablesSortedSetComparator.java index 5de8c4bdcea..e0a741357a9 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ImmutablesSortedSetComparator.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ImmutablesSortedSetComparator.java @@ -11,6 +11,7 @@ import static com.google.errorprone.matchers.Matchers.isSubtypeOf; import static com.google.errorprone.matchers.Matchers.methodReturns; import static com.google.errorprone.matchers.Matchers.not; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; @@ -44,7 +45,7 @@ summary = "`SortedSet` properties of a `@Value.Immutable` or `@Value.Modifiable` type must be " + "annotated with `@Value.NaturalOrder` or `@Value.ReverseOrder`", - link = "https://error-prone.picnic.tech/bugpatterns/ImmutablesSortedSetComparator", + link = BASE_URL_BUGPATTERNS + "ImmutablesSortedSetComparator", linkType = CUSTOM, severity = ERROR, tags = LIKELY_ERROR) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitMethodDeclaration.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitMethodDeclaration.java index 246b812fcef..2085dea4c18 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitMethodDeclaration.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/JUnitMethodDeclaration.java @@ -11,6 +11,7 @@ import static com.google.errorprone.matchers.Matchers.hasModifier; import static com.google.errorprone.matchers.Matchers.isType; import static java.util.function.Predicate.not; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import static tech.picnic.errorprone.bugpatterns.util.JavaKeywords.isReservedKeyword; import com.google.auto.service.AutoService; @@ -47,7 +48,7 @@ @AutoService(BugChecker.class) @BugPattern( summary = "JUnit method declaration can likely be improved", - link = "https://error-prone.picnic.tech/bugpatterns/JUnitMethodDeclaration", + link = BASE_URL_BUGPATTERNS + "JUnitMethodDeclaration", linkType = CUSTOM, severity = SUGGESTION, tags = SIMPLIFICATION) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationAttributeListing.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationAttributeListing.java index 88b4e81ff46..adf4dbca013 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationAttributeListing.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationAttributeListing.java @@ -6,6 +6,7 @@ import static java.util.Comparator.comparing; import static java.util.Comparator.naturalOrder; import static java.util.stream.Collectors.joining; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.common.collect.Comparators; @@ -50,7 +51,7 @@ @AutoService(BugChecker.class) @BugPattern( summary = "Where possible, sort annotation array attributes lexicographically", - link = "https://error-prone.picnic.tech/bugpatterns/LexicographicalAnnotationAttributeListing", + link = BASE_URL_BUGPATTERNS + "LexicographicalAnnotationAttributeListing", linkType = CUSTOM, severity = SUGGESTION, tags = STYLE) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationListing.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationListing.java index b4b23744f9c..913c1373a6d 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationListing.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationListing.java @@ -5,6 +5,7 @@ import static com.google.errorprone.BugPattern.SeverityLevel.SUGGESTION; import static com.google.errorprone.BugPattern.StandardTags.STYLE; import static java.util.Comparator.comparing; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.common.collect.ImmutableList; @@ -31,7 +32,7 @@ @AutoService(BugChecker.class) @BugPattern( summary = "Sort annotations lexicographically where possible", - link = "https://error-prone.picnic.tech/bugpatterns/LexicographicalAnnotationListing", + link = BASE_URL_BUGPATTERNS + "LexicographicalAnnotationListing", linkType = CUSTOM, severity = SUGGESTION, tags = STYLE) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsage.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsage.java index 4cc4a5232cc..0dfb95351f5 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsage.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsage.java @@ -4,6 +4,7 @@ import static com.google.errorprone.BugPattern.LinkType.CUSTOM; import static com.google.errorprone.BugPattern.SeverityLevel.SUGGESTION; import static com.google.errorprone.BugPattern.StandardTags.STYLE; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.common.base.VerifyException; @@ -52,7 +53,7 @@ @AutoService(BugChecker.class) @BugPattern( summary = "Prefer method references over lambda expressions", - link = "https://error-prone.picnic.tech/bugpatterns/MethodReferenceUsage", + link = BASE_URL_BUGPATTERNS + "MethodReferenceUsage", linkType = CUSTOM, severity = SUGGESTION, tags = STYLE) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MissingRefasterAnnotation.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MissingRefasterAnnotation.java index 4a03aa0ee06..260344fb829 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MissingRefasterAnnotation.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MissingRefasterAnnotation.java @@ -7,6 +7,7 @@ import static com.google.errorprone.matchers.Matchers.annotations; import static com.google.errorprone.matchers.Matchers.anyOf; import static com.google.errorprone.matchers.Matchers.isType; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; @@ -25,7 +26,7 @@ @AutoService(BugChecker.class) @BugPattern( summary = "The Refaster template contains a method without any Refaster annotations", - link = "https://error-prone.picnic.tech/bugpatterns/MissingRefasterAnnotation", + link = BASE_URL_BUGPATTERNS + "MissingRefasterAnnotation", linkType = CUSTOM, severity = WARNING, tags = LIKELY_ERROR) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MockitoStubbing.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MockitoStubbing.java index 76945cc8b79..c058a69652b 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MockitoStubbing.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MockitoStubbing.java @@ -4,6 +4,7 @@ import static com.google.errorprone.BugPattern.SeverityLevel.SUGGESTION; import static com.google.errorprone.BugPattern.StandardTags.SIMPLIFICATION; import static com.google.errorprone.matchers.Matchers.staticMethod; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.common.collect.Iterables; @@ -26,7 +27,7 @@ @AutoService(BugChecker.class) @BugPattern( summary = "Don't unnecessarily use Mockito's `eq(...)`", - link = "https://error-prone.picnic.tech/bugpatterns/MockitoStubbing", + link = BASE_URL_BUGPATTERNS + "MockitoStubbing", linkType = CUSTOM, severity = SUGGESTION, tags = SIMPLIFICATION) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NestedOptionals.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NestedOptionals.java index 7a80ab2c85e..d7deff2231e 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NestedOptionals.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NestedOptionals.java @@ -3,6 +3,7 @@ import static com.google.errorprone.BugPattern.LinkType.CUSTOM; import static com.google.errorprone.BugPattern.SeverityLevel.WARNING; import static com.google.errorprone.BugPattern.StandardTags.FRAGILE_CODE; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.common.collect.Iterables; @@ -25,7 +26,7 @@ @BugPattern( summary = "Avoid nesting `Optional`s inside `Optional`s; the resultant code is hard to reason about", - link = "https://error-prone.picnic.tech/bugpatterns/NestedOptionals", + link = BASE_URL_BUGPATTERNS + "NestedOptionals", linkType = CUSTOM, severity = WARNING, tags = FRAGILE_CODE) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NonEmptyMono.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NonEmptyMono.java index 97572e35d49..850408fcb51 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NonEmptyMono.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NonEmptyMono.java @@ -5,6 +5,7 @@ import static com.google.errorprone.BugPattern.StandardTags.SIMPLIFICATION; import static com.google.errorprone.matchers.Matchers.anyOf; import static com.google.errorprone.matchers.Matchers.instanceMethod; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; @@ -28,7 +29,7 @@ @AutoService(BugChecker.class) @BugPattern( summary = "Avoid vacuous operations on known non-empty `Mono`s", - link = "https://error-prone.picnic.tech/bugpatterns/NonEmptyMono", + link = BASE_URL_BUGPATTERNS + "NonEmptyMono", linkType = CUSTOM, severity = WARNING, tags = SIMPLIFICATION) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/PrimitiveComparison.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/PrimitiveComparison.java index 8c77c472669..a8e2876964e 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/PrimitiveComparison.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/PrimitiveComparison.java @@ -7,6 +7,7 @@ import static com.google.errorprone.matchers.method.MethodMatchers.instanceMethod; import static com.google.errorprone.matchers.method.MethodMatchers.staticMethod; import static java.util.stream.Collectors.joining; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.common.base.VerifyException; @@ -44,7 +45,7 @@ summary = "Ensure invocations of `Comparator#comparing{,Double,Int,Long}` match the return type" + " of the provided function", - link = "https://error-prone.picnic.tech/bugpatterns/PrimitiveComparison", + link = BASE_URL_BUGPATTERNS + "PrimitiveComparison", linkType = CUSTOM, severity = WARNING, tags = PERFORMANCE) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RedundantStringConversion.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RedundantStringConversion.java index 435b290726b..8e78cf768be 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RedundantStringConversion.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RedundantStringConversion.java @@ -14,6 +14,7 @@ import static com.google.errorprone.matchers.Matchers.not; import static com.google.errorprone.matchers.method.MethodMatchers.instanceMethod; import static com.google.errorprone.matchers.method.MethodMatchers.staticMethod; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.common.collect.ImmutableList; @@ -55,7 +56,7 @@ @AutoService(BugChecker.class) @BugPattern( summary = "Avoid redundant string conversions when possible", - link = "https://error-prone.picnic.tech/bugpatterns/RedundantStringConversion", + link = BASE_URL_BUGPATTERNS + "RedundantStringConversion", linkType = CUSTOM, severity = SUGGESTION, tags = SIMPLIFICATION) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RefasterAnyOfUsage.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RefasterAnyOfUsage.java index e42ea98a364..5c9796b850a 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RefasterAnyOfUsage.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RefasterAnyOfUsage.java @@ -4,6 +4,7 @@ import static com.google.errorprone.BugPattern.SeverityLevel.SUGGESTION; import static com.google.errorprone.BugPattern.StandardTags.SIMPLIFICATION; import static com.google.errorprone.matchers.method.MethodMatchers.staticMethod; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; @@ -27,7 +28,7 @@ @AutoService(BugChecker.class) @BugPattern( summary = "`Refaster#anyOf` should be passed at least two parameters", - link = "https://error-prone.picnic.tech/bugpatterns/RefasterAnyOfUsage", + link = BASE_URL_BUGPATTERNS + "RefasterAnyOfUsage", linkType = CUSTOM, severity = SUGGESTION, tags = SIMPLIFICATION) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RequestMappingAnnotation.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RequestMappingAnnotation.java index cd82a08cbf3..e829faf3c61 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RequestMappingAnnotation.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RequestMappingAnnotation.java @@ -11,6 +11,7 @@ import static com.google.errorprone.matchers.Matchers.isType; import static com.google.errorprone.matchers.Matchers.methodHasParameters; import static com.google.errorprone.matchers.Matchers.not; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; @@ -31,7 +32,7 @@ @AutoService(BugChecker.class) @BugPattern( summary = "Make sure all `@RequestMapping` method parameters are annotated", - link = "https://error-prone.picnic.tech/bugpatterns/RequestMappingAnnotation", + link = BASE_URL_BUGPATTERNS + "RequestMappingAnnotation", linkType = CUSTOM, severity = WARNING, tags = LIKELY_ERROR) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RequestParamType.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RequestParamType.java index 15d746a627d..360a840dc5e 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RequestParamType.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RequestParamType.java @@ -9,6 +9,7 @@ import static com.google.errorprone.matchers.Matchers.anyOf; import static com.google.errorprone.matchers.Matchers.isSubtypeOf; import static com.google.errorprone.matchers.Matchers.isType; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.common.collect.ImmutableCollection; @@ -25,7 +26,7 @@ @AutoService(BugChecker.class) @BugPattern( summary = "`@RequestParam` does not support `ImmutableCollection` and `ImmutableMap` subtypes", - link = "https://error-prone.picnic.tech/bugpatterns/RequestParamType", + link = BASE_URL_BUGPATTERNS + "RequestParamType", linkType = CUSTOM, severity = ERROR, tags = LIKELY_ERROR) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ScheduledTransactionTrace.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ScheduledTransactionTrace.java index bcb56397509..8e336e8d371 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ScheduledTransactionTrace.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/ScheduledTransactionTrace.java @@ -7,6 +7,7 @@ import static com.google.errorprone.matchers.Matchers.annotations; import static com.google.errorprone.matchers.Matchers.hasAnnotation; import static com.google.errorprone.matchers.Matchers.isType; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.common.AnnotationMirrors; import com.google.auto.service.AutoService; @@ -33,7 +34,7 @@ @AutoService(BugChecker.class) @BugPattern( summary = "Scheduled operation must start a new New Relic transaction", - link = "https://error-prone.picnic.tech/bugpatterns/ScheduledTransactionTrace", + link = BASE_URL_BUGPATTERNS + "ScheduledTransactionTrace", linkType = CUSTOM, severity = ERROR, tags = LIKELY_ERROR) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/Slf4jLogStatement.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/Slf4jLogStatement.java index 5afccbaf2e0..6348bf6cdd8 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/Slf4jLogStatement.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/Slf4jLogStatement.java @@ -6,6 +6,7 @@ import static com.google.errorprone.BugPattern.StandardTags.LIKELY_ERROR; import static com.google.errorprone.matchers.Matchers.isSubtypeOf; import static com.google.errorprone.matchers.method.MethodMatchers.instanceMethod; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.common.base.Splitter; @@ -33,7 +34,7 @@ @AutoService(BugChecker.class) @BugPattern( summary = "Make sure SLF4J log statements contain proper placeholders with matching arguments", - link = "https://error-prone.picnic.tech/bugpatterns/Slf4jLogStatement", + link = BASE_URL_BUGPATTERNS + "Slf4jLogStatement", linkType = CUSTOM, severity = WARNING, tags = LIKELY_ERROR) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/SpringMvcAnnotation.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/SpringMvcAnnotation.java index f751a2f3f27..58f79c039c4 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/SpringMvcAnnotation.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/SpringMvcAnnotation.java @@ -6,6 +6,7 @@ import static com.google.errorprone.BugPattern.StandardTags.SIMPLIFICATION; import static java.util.function.Predicate.not; import static java.util.stream.Collectors.joining; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.common.base.VerifyException; @@ -36,7 +37,7 @@ @BugPattern( summary = "Prefer the conciseness of `@{Get,Put,Post,Delete,Patch}Mapping` over `@RequestMapping`", - link = "https://error-prone.picnic.tech/bugpatterns/SpringMvcAnnotation", + link = BASE_URL_BUGPATTERNS + "SpringMvcAnnotation", linkType = CUSTOM, severity = SUGGESTION, tags = SIMPLIFICATION) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/StaticImport.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/StaticImport.java index 84477412c3a..37bf1bb2d10 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/StaticImport.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/StaticImport.java @@ -4,6 +4,7 @@ import static com.google.errorprone.BugPattern.SeverityLevel.SUGGESTION; import static com.google.errorprone.BugPattern.StandardTags.SIMPLIFICATION; import static java.util.Objects.requireNonNull; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.common.annotations.VisibleForTesting; @@ -46,7 +47,7 @@ @AutoService(BugChecker.class) @BugPattern( summary = "Identifier should be statically imported", - link = "https://error-prone.picnic.tech/bugpatterns/StaticImport", + link = BASE_URL_BUGPATTERNS + "StaticImport", linkType = CUSTOM, severity = SUGGESTION, tags = SIMPLIFICATION) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/TimeZoneUsage.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/TimeZoneUsage.java index 75eb7d68c37..55ab83968b6 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/TimeZoneUsage.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/TimeZoneUsage.java @@ -10,6 +10,7 @@ import static com.google.errorprone.matchers.Matchers.isSubtypeOf; import static com.google.errorprone.matchers.Matchers.not; import static com.google.errorprone.matchers.Matchers.staticMethod; +import static tech.picnic.errorprone.bugpatterns.util.Documentation.BASE_URL_BUGPATTERNS; import com.google.auto.service.AutoService; import com.google.errorprone.BugPattern; @@ -31,7 +32,7 @@ @BugPattern( summary = "Derive the current time from an existing `Clock` Spring bean, and don't rely on a `Clock`'s time zone", - link = "https://error-prone.picnic.tech/bugpatterns/TimeZoneUsage", + link = BASE_URL_BUGPATTERNS + "TimeZoneUsage", linkType = CUSTOM, severity = WARNING, tags = FRAGILE_CODE) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/Documentation.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/Documentation.java new file mode 100644 index 00000000000..94e19b74e9f --- /dev/null +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/util/Documentation.java @@ -0,0 +1,9 @@ +package tech.picnic.errorprone.bugpatterns.util; + +/** Utility class used for documentation related code. */ +public final class Documentation { + /** The base URL for linking BugPatterns to the website. */ + public static final String BASE_URL_BUGPATTERNS = "https://error-prone.picnic.tech/bugpatterns/"; + + private Documentation() {} +} diff --git a/refaster-runner/src/main/java/tech/picnic/errorprone/refaster/runner/Refaster.java b/refaster-runner/src/main/java/tech/picnic/errorprone/refaster/runner/Refaster.java index 97dbe4ef05b..b6e7d196007 100644 --- a/refaster-runner/src/main/java/tech/picnic/errorprone/refaster/runner/Refaster.java +++ b/refaster-runner/src/main/java/tech/picnic/errorprone/refaster/runner/Refaster.java @@ -2,7 +2,7 @@ import static com.google.common.collect.ImmutableList.toImmutableList; import static com.google.common.collect.ImmutableRangeSet.toImmutableRangeSet; -import static com.google.errorprone.BugPattern.LinkType.CUSTOM; +import static com.google.errorprone.BugPattern.LinkType.NONE; import static com.google.errorprone.BugPattern.SeverityLevel.SUGGESTION; import static com.google.errorprone.BugPattern.StandardTags.SIMPLIFICATION; import static java.util.function.Predicate.not; @@ -47,8 +47,7 @@ @AutoService(BugChecker.class) @BugPattern( summary = "Write idiomatic code when possible", - link = "https://error-prone.picnic.tech/bugpatterns/AmbiguousJsonCreator", - linkType = CUSTOM, + linkType = NONE, severity = SUGGESTION, tags = SIMPLIFICATION) public final class Refaster extends BugChecker implements CompilationUnitTreeMatcher {