Thin the app's comments
The same pass the server had, on the Kotlin side: comments restating what the code says are gone, and the ones recording a measurement, a constraint or an incident are kept but cut to a few lines each. 6540 comment lines to 5674, and 920 lines off the app. Two doc comments had drifted onto the item above the one they describe -- `contextAfter`'s onto `sessionWorking` in Events.kt, and `UsageMonitor`'s equivalent on the server was fixed in the previous commit. Each is back on its own item, which is the only non-comment line this diff moves. The comments are reflowed to the column limit at their own indentation: several were written wide, and ktfmt re-wrapped them into lines holding a single orphan word. `/tmp` script, not kept -- ktfmt is idempotent over the result, which is the check. Left alone deliberately: this codebase's remaining comment density is high because the comments carry things the code cannot say -- what a null means, what a number was measured against, which bug a guard exists for. Of the 238 one-line doc comments in the app, five were pure restatement of the name and were removed; the rest each say something the signature does not. ktfmtFormat, compileDebugKotlin, lintDebug and testDebugUnitTest pass; cargo test (127), clippy --all-targets and fmt still clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
79682f03a7
commit
edc39c7371
68 files changed
+2077
-2997
No files matched your search
@@ -12,10 +12,9 @@ import java.util.Locale
|
||||
* The last crash, kept so the debug button can hand it over.
|
||||
*
|
||||
* The alternative is asking somebody to reproduce a crash with the phone plugged into a computer
|
||||
* and `logcat` running, which is the one thing nobody has set up at the moment it happens -- and a
|
||||
* crash report that arrives a day later, without the stack, is a guess. This costs one file write
|
||||
* on a process that is already dying, and it turns "it crashes when I open that chat" into the
|
||||
* frame it crashed in.
|
||||
* and `logcat` running, which is the one thing nobody has set up at the moment it happens. This
|
||||
* costs one file write on a process that is already dying, and it turns "it crashes when I open
|
||||
* that chat" into the frame it crashed in.
|
||||
*
|
||||
* Kept until it is read rather than cleared on the next launch: the app restarts before anybody can
|
||||
* ask about it, so a log that lives for one session is a log that is never read.
|
||||
@@ -26,8 +25,7 @@ private const val CRASH_FILE = "last-crash.txt"
|
||||
* How much of a stack is kept.
|
||||
*
|
||||
* This is pasted into a conversation, so it has a budget like any other output written for a
|
||||
* reader. The top of a stack is what identifies a crash and the bottom is framework plumbing, so
|
||||
* what gets cut is the part nobody reads.
|
||||
* reader. The top of a stack is what identifies a crash and the bottom is framework plumbing.
|
||||
*/
|
||||
private const val CRASH_LIMIT = 4000
|
||||
|
||||
@@ -35,8 +33,7 @@ private const val CRASH_LIMIT = 4000
|
||||
* Records uncaught exceptions, then lets the platform do what it was going to do.
|
||||
*
|
||||
* Chained rather than replacing: the default handler is what shows the "app has stopped" dialog and
|
||||
* ends the process, and an app that swallows that instead sits there in an unknown state. This only
|
||||
* adds a witness.
|
||||
* ends the process, and an app that swallows that instead sits there in an unknown state.
|
||||
*/
|
||||
fun installCrashLog(context: Context) {
|
||||
val app = context.applicationContext
|
||||
|
||||
Reference in new issue
Block a user