Fix incorrect lint explanation string formats
Test: all tests pass
Change-Id: I8d0c7c3899d1450747159f399ce611e479aaccf0
diff --git a/fragment/fragment-lint/src/main/java/androidx/fragment/lint/FragmentTagDetector.kt b/fragment/fragment-lint/src/main/java/androidx/fragment/lint/FragmentTagDetector.kt
index 7730d75..2c31fb91 100644
--- a/fragment/fragment-lint/src/main/java/androidx/fragment/lint/FragmentTagDetector.kt
+++ b/fragment/fragment-lint/src/main/java/androidx/fragment/lint/FragmentTagDetector.kt
@@ -39,11 +39,11 @@
val ISSUE = Issue.create(
id = "FragmentTagUsage",
briefDescription = "Use FragmentContainerView instead of the <fragment> tag",
- explanation = """FragmentContainerView replaces the <fragment> tag as the preferred way
- | of adding fragments via XML. Unlike the <fragment> tag, FragmentContainerView uses
- | a normal `FragmentTransaction` under the hood to add the initial fragment,
- | allowing further FragmentTransaction operations on the FragmentContainerView
- | and providing a consistent timing for lifecycle events.""",
+ explanation = """FragmentContainerView replaces the <fragment> tag as the preferred \
+ way of adding fragments via XML. Unlike the <fragment> tag, FragmentContainerView \
+ uses a normal `FragmentTransaction` under the hood to add the initial fragment, \
+ allowing further FragmentTransaction operations on the FragmentContainerView \
+ and providing a consistent timing for lifecycle events.""",
category = Category.CORRECTNESS,
severity = Severity.WARNING,
implementation = Implementation(
diff --git a/fragment/fragment-lint/src/main/java/androidx/fragment/lint/UnsafeFragmentLifecycleObserverDetector.kt b/fragment/fragment-lint/src/main/java/androidx/fragment/lint/UnsafeFragmentLifecycleObserverDetector.kt
index e8ad725..447a8b6 100644
--- a/fragment/fragment-lint/src/main/java/androidx/fragment/lint/UnsafeFragmentLifecycleObserverDetector.kt
+++ b/fragment/fragment-lint/src/main/java/androidx/fragment/lint/UnsafeFragmentLifecycleObserverDetector.kt
@@ -49,12 +49,12 @@
id = "FragmentLiveDataObserve",
briefDescription = "Use getViewLifecycleOwner() as the LifecycleOwner instead of " +
"a Fragment instance when observing a LiveData object.",
- explanation = """When observing a LiveData object from a fragment's onCreateView,
- | onViewCreated, onActivityCreated, or onViewStateRestored method
- | getViewLifecycleOwner() should be used as the LifecycleOwner rather than the
- | Fragment instance. The Fragment lifecycle can result in the Fragment being
- | active longer than its view. This can lead to unexpected behavior from
- | LiveData objects being observed longer than the Fragment's view is active.""",
+ explanation = """When observing a LiveData object from a fragment's onCreateView, \
+ onViewCreated, onActivityCreated, or onViewStateRestored method \
+ getViewLifecycleOwner() should be used as the LifecycleOwner rather than the \
+ Fragment instance. The Fragment lifecycle can result in the Fragment being \
+ active longer than its view. This can lead to unexpected behavior from \
+ LiveData objects being observed longer than the Fragment's view is active.""",
category = Category.CORRECTNESS,
severity = Severity.ERROR,
implementation = Implementation(
@@ -67,13 +67,13 @@
id = "FragmentBackPressedCallback",
briefDescription = "Use getViewLifecycleOwner() as the LifecycleOwner instead of " +
"a Fragment instance.",
- explanation = """The Fragment lifecycle can result in a Fragment being active
- | longer than its view. This can lead to unexpected behavior from lifecycle aware
- | objects remaining active longer than the Fragment's view. To solve this issue,
- | getViewLifecycleOwner() should be used as a LifecycleOwner rather than the
- | Fragment instance once it is safe to access the view lifecycle in a
- | Fragment's onCreateView, onViewCreated, onActivityCreated, or
- | onViewStateRestored methods.""",
+ explanation = """The Fragment lifecycle can result in a Fragment being active \
+ longer than its view. This can lead to unexpected behavior from lifecycle aware \
+ objects remaining active longer than the Fragment's view. To solve this issue, \
+ getViewLifecycleOwner() should be used as a LifecycleOwner rather than the \
+ Fragment instance once it is safe to access the view lifecycle in a \
+ Fragment's onCreateView, onViewCreated, onActivityCreated, or \
+ onViewStateRestored methods.""",
category = Category.CORRECTNESS,
severity = Severity.ERROR,
implementation = Implementation(
diff --git a/fragment/fragment-testing-lint/src/main/java/androidx/fragment/testing/lint/GradleConfigurationDetector.kt b/fragment/fragment-testing-lint/src/main/java/androidx/fragment/testing/lint/GradleConfigurationDetector.kt
index f7320a8..4ad3dec 100644
--- a/fragment/fragment-testing-lint/src/main/java/androidx/fragment/testing/lint/GradleConfigurationDetector.kt
+++ b/fragment/fragment-testing-lint/src/main/java/androidx/fragment/testing/lint/GradleConfigurationDetector.kt
@@ -35,10 +35,10 @@
id = "FragmentGradleConfiguration",
briefDescription = "Include the fragment-testing library using the " +
"debugImplementation configuration.",
- explanation = """The fragment-testing library contains a FragmentScenario class that
- | creates an Activity that must exist in the runtime APK. To include the
- | fragment-testing library in the runtime APK it must be added using the
- | debugImplementation configuration.""",
+ explanation = """The fragment-testing library contains a FragmentScenario class that \
+ creates an Activity that must exist in the runtime APK. To include the \
+ fragment-testing library in the runtime APK it must be added using the \
+ debugImplementation configuration.""",
category = Category.CORRECTNESS,
severity = Severity.ERROR,
implementation = Implementation(