Skip to content

Commit

Permalink
Fix some block-comment-initial-star-alignment ktlint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
FloEdelmann committed Jan 4, 2024
1 parent e394df8 commit bc79ca2
Show file tree
Hide file tree
Showing 19 changed files with 55 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ fun findNodesAtCrossingsOf(barrierWays: Sequence<Way>, movingWays: Sequence<Way>
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ fun createCyclewaySides(tags: Map<String, String>, 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ class MarkCompletedHighwayConstruction : OsmFilterQuestType<CompletedConstructio
val isFootway = tags["construction"] == "footway"
val isSteps = tags["construction"] == "steps"
/* Alternative could be "Is this construction finished?" and just display the feature name
* (e.g. "cycleway under construction") of the element above, but there are no iD presets
* for "highway=construction + construction=*" so such road would just be named
* "Road closed". Hence, keeping this (for now). */
* (e.g. "cycleway under construction") of the element above, but there are no iD presets
* for "highway=construction + construction=*" so such road would just be named
* "Road closed". Hence, keeping this (for now). */
return when {
isRoad -> R.string.quest_construction_road_title
isCycleway -> R.string.quest_construction_cycleway_title
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class AddLevel : OsmElementQuestType<String> {
""".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()})
Expand All @@ -43,8 +43,8 @@ class AddLevel : OsmElementQuestType<String> {
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AddPostboxCollectionTimes : OsmElementQuestType<CollectionTimesAnswer> {
""".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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ class AddRailwayCrossingBarrier : OsmElementQuestType<RailwayCrossingBarrier> {
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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ------------------------------------- */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 --------------------------------------- */

Expand Down

0 comments on commit bc79ca2

Please sign in to comment.