From bc79ca285da17be5a222c0e8e99f94e736b9ed16 Mon Sep 17 00:00:00 2001 From: Flo Edelmann Date: Tue, 2 Jan 2024 20:56:33 +0100 Subject: [PATCH] Fix some `block-comment-initial-star-alignment` ktlint issues --- .../maptiles/MapTilesDownloadCacheConfig.kt | 2 +- .../data/maptiles/MapTilesDownloader.kt | 4 +-- .../data/messages/MessagesSource.kt | 2 +- .../data/osmnotes/NoteController.kt | 2 +- .../osmnotes/edits/NotesWithEditsSource.kt | 4 +-- .../streetcomplete/osm/ResurveyUtils.kt | 6 ++-- .../streetcomplete/osm/WaysCrossings.kt | 30 +++++++++---------- .../osm/cycleway/CyclewayParser.kt | 10 +++---- .../streetcomplete/quests/QuestsModule.kt | 2 +- .../MarkCompletedHighwayConstruction.kt | 6 ++-- .../streetcomplete/quests/level/AddLevel.kt | 6 ++-- .../AddPostboxCollectionTimes.kt | 2 +- .../AddRailwayCrossingBarrier.kt | 8 ++--- .../quests/steps_ramp/AddStepsRamp.kt | 6 ++-- .../main/controls/UndoButtonFragment.kt | 2 +- .../questselection/QuestSelectionAdapter.kt | 2 +- .../achievements/AchievementInfoFragment.kt | 8 ++--- .../osm/cycleway/CyclewayParserKtTest.kt | 4 +-- .../osm/sidewalk/SidewalkParserKtTest.kt | 4 +-- 19 files changed, 55 insertions(+), 55 deletions(-) diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/maptiles/MapTilesDownloadCacheConfig.kt b/app/src/main/java/de/westnordost/streetcomplete/data/maptiles/MapTilesDownloadCacheConfig.kt index 4e51eafd7ec..775209ff8f0 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/data/maptiles/MapTilesDownloadCacheConfig.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/data/maptiles/MapTilesDownloadCacheConfig.kt @@ -19,7 +19,7 @@ class MapTilesDownloadCacheConfig(context: Context, prefs: Preferences) { .build() /* use separate cache control for tangram with large maxStale value to always show available - * map tiles when panning the map, even without (or with bad) internet connection */ + * map tiles when panning the map, even without (or with bad) internet connection */ val tangramCacheControl: CacheControl = CacheControl.Builder() .maxAge(12, TimeUnit.HOURS) .maxStale(10 * 365, TimeUnit.DAYS) // ten years diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/maptiles/MapTilesDownloader.kt b/app/src/main/java/de/westnordost/streetcomplete/data/maptiles/MapTilesDownloader.kt index a75e362200c..50663a6209a 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/data/maptiles/MapTilesDownloader.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/data/maptiles/MapTilesDownloader.kt @@ -82,8 +82,8 @@ class MapTilesDownloader( val call = okHttpClient.newCall(builder.build()) /* since we use coroutines and this is in the background anyway, why not use call.execute()? - * Because we want to let the OkHttp dispatcher control how many HTTP requests are made in - * parallel */ + * Because we want to let the OkHttp dispatcher control how many HTTP requests are made in + * parallel */ val callback = object : Callback { override fun onFailure(call: Call, e: IOException) { Log.w(TAG, "Error retrieving tile $zoom/$x/$y: ${e.message}") diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/messages/MessagesSource.kt b/app/src/main/java/de/westnordost/streetcomplete/data/messages/MessagesSource.kt index 49868347e37..c866a571fa8 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/data/messages/MessagesSource.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/data/messages/MessagesSource.kt @@ -18,7 +18,7 @@ class MessagesSource( private val prefs: Preferences ) { /* Must be a singleton because there is a listener that should respond to a change in the - * database table*/ + * database table*/ interface UpdateListener { fun onNumberOfMessagesUpdated(numberOfMessages: Int) diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/osmnotes/NoteController.kt b/app/src/main/java/de/westnordost/streetcomplete/data/osmnotes/NoteController.kt index 73907afd99e..cee71afe51c 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/data/osmnotes/NoteController.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/data/osmnotes/NoteController.kt @@ -12,7 +12,7 @@ class NoteController( private val dao: NoteDao ) { /* Must be a singleton because there is a listener that should respond to a change in the - * database table */ + * database table */ /** Interface to be notified of new notes, updated notes and notes that have been deleted */ interface Listener { diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/osmnotes/edits/NotesWithEditsSource.kt b/app/src/main/java/de/westnordost/streetcomplete/data/osmnotes/edits/NotesWithEditsSource.kt index 34fd40bad6b..67cf2e3875d 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/data/osmnotes/edits/NotesWithEditsSource.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/data/osmnotes/edits/NotesWithEditsSource.kt @@ -45,8 +45,8 @@ class NotesWithEditsSource( private val noteEditsListener = object : NoteEditsSource.Listener { override fun onAddedEdit(edit: NoteEdit) { /* can't just get the associated note from DB and apply this edit to it because this - * edit might just be the last in a long chain of edits, i.e. if several comments - * are added to a note, or if a note is created through an edit (and then commented) */ + * edit might just be the last in a long chain of edits, i.e. if several comments + * are added to a note, or if a note is created through an edit (and then commented) */ val note = get(edit.noteId) ?: return if (edit.action == CREATE) callOnUpdated(added = listOf(note)) diff --git a/app/src/main/java/de/westnordost/streetcomplete/osm/ResurveyUtils.kt b/app/src/main/java/de/westnordost/streetcomplete/osm/ResurveyUtils.kt index c0db1317480..3bd60545f6d 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/osm/ResurveyUtils.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/osm/ResurveyUtils.kt @@ -44,9 +44,9 @@ fun Tags.updateWithCheckDate(key: String, value: String) { val previousValue = get(key) set(key, value) /* if the value is changed, set the check date only if it has been set before. Behavior - * before v32.0 was to delete the check date. However, this destroys data that was - * previously collected by another surveyor - we don't want to destroy other people's data - * */ + * before v32.0 was to delete the check date. However, this destroys data that was + * previously collected by another surveyor - we don't want to destroy other people's data + */ if (previousValue == value || hasCheckDateForKey(key)) { updateCheckDateForKey(key) } diff --git a/app/src/main/java/de/westnordost/streetcomplete/osm/WaysCrossings.kt b/app/src/main/java/de/westnordost/streetcomplete/osm/WaysCrossings.kt index 301771ae6b1..915f3657a68 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/osm/WaysCrossings.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/osm/WaysCrossings.kt @@ -37,21 +37,21 @@ fun findNodesAtCrossingsOf(barrierWays: Sequence, movingWays: Sequence waysByNodeId.keys.retainAll(barriersByNodeId.keys) /* finally, filter out all shared nodes where the footway(s) do not actually cross the barrier(s). - * There are two situations which both need to be handled: - * - * 1. The shared node is contained in a both ways and it is not an end - * node of any of the involved ways, e.g. - * https://www.openstreetmap.org/node/2225781269 (intersecting footways with barriers) - * https://www.openstreetmap.org/node/8418974983 (intersecting footways with roads) - * - * 2. The barrier way or the footway way or both actually end on the shared node but are - * connected to another which continues the way after - * https://www.openstreetmap.org/node/2458449002 (transition of footway to steps - intersecting with barrier) - * https://www.openstreetmap.org/node/1641565064 (intersecting footways with roads) - * - * So, for the algorithm, it should be irrelevant to which way(s) the segments around the - * shared node belong, what count are the positions / angles. - */ + * There are two situations which both need to be handled: + * + * 1. The shared node is contained in a both ways and it is not an end + * node of any of the involved ways, e.g. + * https://www.openstreetmap.org/node/2225781269 (intersecting footways with barriers) + * https://www.openstreetmap.org/node/8418974983 (intersecting footways with roads) + * + * 2. The barrier way or the footway way or both actually end on the shared node but are + * connected to another which continues the way after + * https://www.openstreetmap.org/node/2458449002 (transition of footway to steps - intersecting with barrier) + * https://www.openstreetmap.org/node/1641565064 (intersecting footways with roads) + * + * So, for the algorithm, it should be irrelevant to which way(s) the segments around the + * shared node belong, what count are the positions / angles. + */ waysByNodeId.entries.retainAll { (nodeId, ways) -> val barriers = barriersByNodeId.getValue(nodeId) diff --git a/app/src/main/java/de/westnordost/streetcomplete/osm/cycleway/CyclewayParser.kt b/app/src/main/java/de/westnordost/streetcomplete/osm/cycleway/CyclewayParser.kt index b4bb9e0dac9..b5660182a3d 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/osm/cycleway/CyclewayParser.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/osm/cycleway/CyclewayParser.kt @@ -31,11 +31,11 @@ fun createCyclewaySides(tags: Map, isLeftHandTraffic: Boolean): val expandedTags = expandRelevantSidesTags(tags) /* For oneways, the naked "cycleway"-keys should be interpreted differently: - * E.g. a cycleway=lane in a oneway=yes probably means that only in the flow direction, there - * is a lane. E.g. cycleway=opposite_lane means that there is a lane in opposite traffic flow - * direction. - * Whether there is anything each in the other direction, is not defined, so we have to treat - * it that way. */ + * E.g. a cycleway=lane in a oneway=yes probably means that only in the flow direction, there + * is a lane. E.g. cycleway=opposite_lane means that there is a lane in opposite traffic flow + * direction. + * Whether there is anything each in the other direction, is not defined, so we have to treat + * it that way. */ val nakedCycleway = createCyclewayForSide(expandedTags, null) if (isOneway && nakedCycleway != null && nakedCycleway != NONE) { if (isOpposite == isReverseSideRight) { diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/QuestsModule.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/QuestsModule.kt index 1ce258a4665..1d5c75f66ec 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/QuestsModule.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/QuestsModule.kt @@ -505,7 +505,7 @@ fun questTypeRegistry( 148 to AddCyclewayWidth(arSupportChecker), // should be after cycleway segregation /* should best be after road surface because it excludes unpaved roads, also, need to search - * for the sign which is one reason why it is disabled by default */ + * for the sign which is one reason why it is disabled by default */ 149 to AddMaxSpeed(), // buildings diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/construction/MarkCompletedHighwayConstruction.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/construction/MarkCompletedHighwayConstruction.kt index b808e9b1d26..f99fa764766 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/construction/MarkCompletedHighwayConstruction.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/construction/MarkCompletedHighwayConstruction.kt @@ -28,9 +28,9 @@ class MarkCompletedHighwayConstruction : OsmFilterQuestType R.string.quest_construction_road_title isCycleway -> R.string.quest_construction_cycleway_title diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/level/AddLevel.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/level/AddLevel.kt index 466f68a2a5f..8adde14bde7 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/level/AddLevel.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/level/AddLevel.kt @@ -31,7 +31,7 @@ class AddLevel : OsmElementQuestType { """.toElementFilterExpression() } /* only nodes because ways/relations are not likely to be floating around freely in a mall - * outline */ + * outline */ private val filter by lazy { """ nodes with (${isShopExpressionFragment()}) @@ -43,8 +43,8 @@ class AddLevel : OsmElementQuestType { override val wikiLink = "Key:level" override val icon = R.drawable.ic_quest_level /* disabled because in a mall with multiple levels, if there are nodes with no level defined, - * it really makes no sense to tag something as vacant if the level is not known. Instead, if - * the user cannot find the place on any level in the mall, delete the element completely. */ + * it really makes no sense to tag something as vacant if the level is not known. Instead, if + * the user cannot find the place on any level in the mall, delete the element completely. */ override val isReplaceShopEnabled = false override val isDeleteElementEnabled = true override val achievements = listOf(CITIZEN) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/postbox_collection_times/AddPostboxCollectionTimes.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/postbox_collection_times/AddPostboxCollectionTimes.kt index d952d8b989d..105c27a9cba 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/postbox_collection_times/AddPostboxCollectionTimes.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/postbox_collection_times/AddPostboxCollectionTimes.kt @@ -24,7 +24,7 @@ class AddPostboxCollectionTimes : OsmElementQuestType { """.toElementFilterExpression() } /* Don't ask again for postboxes without signed collection times. This is very unlikely to - * change and problematic to tag clearly with the check date scheme */ + * change and problematic to tag clearly with the check date scheme */ override val changesetComment = "Survey postbox collection times" override val wikiLink = "Key:collection_times" diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/railway_crossing/AddRailwayCrossingBarrier.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/railway_crossing/AddRailwayCrossingBarrier.kt index d77b8f643d6..9634d141d0f 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/railway_crossing/AddRailwayCrossingBarrier.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/railway_crossing/AddRailwayCrossingBarrier.kt @@ -57,10 +57,10 @@ class AddRailwayCrossingBarrier : OsmElementQuestType { tags.updateWithCheckDate("crossing:barrier", answer.osmValue) } /* The mere existence of the crossing:chicane tag seems to imply that there could be a - * barrier additionally to the chicane. - * However, we still tag crossing:barrier=no here because the illustration as shown - * in the app corresponds to the below tagging - it shows just a chicane and no further - * barriers */ + * barrier additionally to the chicane. + * However, we still tag crossing:barrier=no here because the illustration as shown + * in the app corresponds to the below tagging - it shows just a chicane and no further + * barriers */ if (answer == RailwayCrossingBarrier.CHICANE) { tags.updateWithCheckDate("crossing:barrier", "no") tags["crossing:chicane"] = "yes" diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/steps_ramp/AddStepsRamp.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/steps_ramp/AddStepsRamp.kt index 026cf2d6860..098fe011897 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/steps_ramp/AddStepsRamp.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/steps_ramp/AddStepsRamp.kt @@ -67,9 +67,9 @@ private fun applyRampAnswer(tags: Tags, rampType: String, hasRamp: Boolean, ramp tags["ramp:$rampType"] = "yes" } else if (rampTagForcedToBeYes) { /* if there is an unsupported ramp:*=yes tag but at the same time, there is neither a - * bicycle, stroller nor wheelchair ramp, the ramp key will remain =yes. But then, nothing - * else will be tagged and thus, the quest will still remain. So in this case, we tag - * the user's choices as "no" explicitly. See #3115 */ + * bicycle, stroller nor wheelchair ramp, the ramp key will remain =yes. But then, nothing + * else will be tagged and thus, the quest will still remain. So in this case, we tag + * the user's choices as "no" explicitly. See #3115 */ tags["ramp:$rampType"] = "no" } else if (tags["ramp:$rampType"] in listOf("yes", "separate")) { tags.remove("ramp:$rampType") diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/main/controls/UndoButtonFragment.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/main/controls/UndoButtonFragment.kt index 1cf91012cb5..92ce2b3afb6 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/main/controls/UndoButtonFragment.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/main/controls/UndoButtonFragment.kt @@ -41,7 +41,7 @@ class UndoButtonFragment : Fragment(R.layout.fragment_undo_button) { } /* Don't allow undoing while uploading. Should prevent race conditions. (Undoing quest while - * also uploading it at the same time) */ + * also uploading it at the same time) */ private val uploadProgressListener = object : UploadProgressListener { override fun onStarted() { viewLifecycleScope.launch { updateUndoButtonEnablement(false) } } override fun onFinished() { viewLifecycleScope.launch { updateUndoButtonEnablement(true) } } diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/settings/questselection/QuestSelectionAdapter.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/settings/questselection/QuestSelectionAdapter.kt index 0d2b9b46b46..d6ae881ce97 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/settings/questselection/QuestSelectionAdapter.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/settings/questselection/QuestSelectionAdapter.kt @@ -227,7 +227,7 @@ class QuestSelectionAdapter( private fun onDropped() { val qt = questTypesDuringDrag /* since we modify the quest list during move (in onMove) for the animation, the quest - * type we dragged is now already at the position we want it to be. */ + * type we dragged is now already at the position we want it to be. */ if (draggedTo != draggedFrom && draggedTo > 0 && qt != null) { val item = qt[draggedTo].questType val toAfter = qt[draggedTo - 1].questType diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/user/achievements/AchievementInfoFragment.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/user/achievements/AchievementInfoFragment.kt index 69cc1180bca..28b71f909f9 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/user/achievements/AchievementInfoFragment.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/user/achievements/AchievementInfoFragment.kt @@ -266,10 +266,10 @@ class AchievementInfoFragment : Fragment(R.layout.fragment_achievement_info) { it.scaleY = 0.5f it.translationY = 0f /* For the "show new achievement" mode, only the icon is shown first and only after a - * delay, the dialog with the description etc. - * This icon is in the center at first and should animate up while the dialog becomes - * visible. This movement is solved via a (default) layout transition here for which the - * APPEARING transition type is disabled because we animate the alpha ourselves. */ + * delay, the dialog with the description etc. + * This icon is in the center at first and should animate up while the dialog becomes + * visible. This movement is solved via a (default) layout transition here for which the + * APPEARING transition type is disabled because we animate the alpha ourselves. */ it.isGone = startDelay > 0 it.animate() .setStartDelay(startDelay) diff --git a/app/src/test/java/de/westnordost/streetcomplete/osm/cycleway/CyclewayParserKtTest.kt b/app/src/test/java/de/westnordost/streetcomplete/osm/cycleway/CyclewayParserKtTest.kt index 454158b2524..2c4bf737a01 100644 --- a/app/src/test/java/de/westnordost/streetcomplete/osm/cycleway/CyclewayParserKtTest.kt +++ b/app/src/test/java/de/westnordost/streetcomplete/osm/cycleway/CyclewayParserKtTest.kt @@ -8,8 +8,8 @@ import kotlin.test.assertNull class CyclewayParserKtTest { /* These are a lot of tests because there are many possible permutations and this test does not - * make (much) assumptions that the code is written in a way that if it is solved for one type, - * it is solved for all */ + * make (much) assumptions that the code is written in a way that if it is solved for one type, + * it is solved for all */ /* -------------------------------------- special cases ------------------------------------- */ diff --git a/app/src/test/java/de/westnordost/streetcomplete/osm/sidewalk/SidewalkParserKtTest.kt b/app/src/test/java/de/westnordost/streetcomplete/osm/sidewalk/SidewalkParserKtTest.kt index 84ea6612392..af044638136 100644 --- a/app/src/test/java/de/westnordost/streetcomplete/osm/sidewalk/SidewalkParserKtTest.kt +++ b/app/src/test/java/de/westnordost/streetcomplete/osm/sidewalk/SidewalkParserKtTest.kt @@ -9,8 +9,8 @@ import kotlin.test.assertEquals class SidewalkParserKtTest { /* These are a lot of tests because there are many possible permutations and this test does not - * make (many) assumptions that the code is written in a way that if it is solved for one type, - * it is solved for all */ + * make (many) assumptions that the code is written in a way that if it is solved for one type, + * it is solved for all */ /* ------------------------------------------ invalid --------------------------------------- */