Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ktlint #140

Merged
merged 2 commits into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
600 changes: 1 addition & 599 deletions .editorconfig

Large diffs are not rendered by default.

128 changes: 128 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,13 @@ tasks {

doLast {
val langs = getListOfSupportedLocales()
val localesConfig = """
val localesConfig =
"""
<?xml version="1.0" encoding="utf-8"?>
<locale-config xmlns:android="http://schemas.android.com/apk/res/android">
${langs.joinToString("\n") { " <locale android:name=\"$it\"/>" }}
${langs.joinToString(" ") { "<locale android:name=\"$it\"/>" }}
</locale-config>
""".trimIndent()
""".trimIndent()

localesConfigFile.bufferedWriter().use { writer ->
writer.write(localesConfig)
Expand All @@ -290,9 +291,8 @@ ${langs.joinToString("\n") { " <locale android:name=\"$it\"/>"
class RoomSchemaArgProvider(
@get:InputDirectory
@get:PathSensitive(PathSensitivity.RELATIVE)
val schemaDir: File
val schemaDir: File,
) : CommandLineArgumentProvider {

override fun asArguments(): Iterable<String> {
// Note: If you're using KSP, change the line below to return
return listOf("room.schemaLocation=${schemaDir.path}")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.nononsenseapps.feeder.crypto

import kotlin.test.assertEquals
import org.junit.Test
import kotlin.test.assertEquals

class AesCbcWithIntegrityTest {
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ const val LEGACY_DATABASE_NAME = DATABASE_NAME
class LegacyDatabaseHandler constructor(
context: Context,
name: String = LEGACY_DATABASE_NAME,
version: Int = LEGACY_DATABASE_VERSION
version: Int = LEGACY_DATABASE_VERSION,
) : SQLiteOpenHelper(context, name, null, version) {

override fun onCreate(db: SQLiteDatabase) {
}

override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {
override fun onUpgrade(
db: SQLiteDatabase,
oldVersion: Int,
newVersion: Int,
) {
}

override fun onOpen(db: SQLiteDatabase) {
Expand Down Expand Up @@ -46,6 +49,7 @@ const val FEED_ITEM_TABLE_NAME = "FeedItem"
// Naming the id column with an underscore is good to be consistent
// with other Android things. This is ALWAYS needed
const val COL_ID = "_id"

// These fields can be anything you want.
const val COL_TITLE = "title"
const val COL_CUSTOM_TITLE = "customtitle"
Expand All @@ -63,6 +67,7 @@ const val COL_AUTHOR = "author"
const val COL_PUBDATE = "pubdate"
const val COL_UNREAD = "unread"
const val COL_NOTIFIED = "notified"

// These fields corresponds to columns in Feed table
const val COL_FEED = "feed"
const val COL_FEEDTITLE = "feedtitle"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ class MigrationFrom10To11 {

@Rule
@JvmField
val testHelper: MigrationTestHelper = MigrationTestHelper(
InstrumentationRegistry.getInstrumentation(),
AppDatabase::class.java,
emptyList(),
FrameworkSQLiteOpenHelperFactory(),
)
val testHelper: MigrationTestHelper =
MigrationTestHelper(
InstrumentationRegistry.getInstrumentation(),
AppDatabase::class.java,
emptyList(),
FrameworkSQLiteOpenHelperFactory(),
)

@Test
fun migrate10to11() {
Expand All @@ -31,15 +32,15 @@ class MigrationFrom10To11 {
db.use {
db.execSQL(
"""
INSERT INTO feeds(id, title, url, custom_title, tag, notify, last_sync, response_hash)
VALUES(1, 'feed', 'http://url', '', '', 0, 0, 666)
INSERT INTO feeds(id, title, url, custom_title, tag, notify, last_sync, response_hash)
VALUES(1, 'feed', 'http://url', '', '', 0, 0, 666)
""".trimIndent(),
)

db.execSQL(
"""
INSERT INTO feed_items(id, guid, title, plain_title, plain_snippet, unread, notified, feed_id)
VALUES(8, 'http://item', 'title', 'ptitle', 'psnippet', 1, 0, 1)
INSERT INTO feed_items(id, guid, title, plain_title, plain_snippet, unread, notified, feed_id)
VALUES(8, 'http://item', 'title', 'ptitle', 'psnippet', 1, 0, 1)
""".trimIndent(),
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ class MigrationFrom11To12 {

@Rule
@JvmField
val testHelper: MigrationTestHelper = MigrationTestHelper(
InstrumentationRegistry.getInstrumentation(),
AppDatabase::class.java,
emptyList(),
FrameworkSQLiteOpenHelperFactory(),
)
val testHelper: MigrationTestHelper =
MigrationTestHelper(
InstrumentationRegistry.getInstrumentation(),
AppDatabase::class.java,
emptyList(),
FrameworkSQLiteOpenHelperFactory(),
)

@Test
fun migrate11to12() {
Expand All @@ -31,15 +32,15 @@ class MigrationFrom11To12 {
db.use {
db.execSQL(
"""
INSERT INTO feeds(id, title, url, custom_title, tag, notify, last_sync, response_hash)
VALUES(1, 'feed', 'http://url', '', '', 0, 0, 666)
INSERT INTO feeds(id, title, url, custom_title, tag, notify, last_sync, response_hash)
VALUES(1, 'feed', 'http://url', '', '', 0, 0, 666)
""".trimIndent(),
)

db.execSQL(
"""
INSERT INTO feed_items(id, guid, title, plain_title, plain_snippet, unread, notified, feed_id, first_synced_time)
VALUES(8, 'http://item', 'title', 'ptitle', 'psnippet', 1, 0, 1, 0)
INSERT INTO feed_items(id, guid, title, plain_title, plain_snippet, unread, notified, feed_id, first_synced_time)
VALUES(8, 'http://item', 'title', 'ptitle', 'psnippet', 1, 0, 1, 0)
""".trimIndent(),
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ class MigrationFrom12To13 {

@Rule
@JvmField
val testHelper: MigrationTestHelper = MigrationTestHelper(
InstrumentationRegistry.getInstrumentation(),
AppDatabase::class.java,
emptyList(),
FrameworkSQLiteOpenHelperFactory(),
)
val testHelper: MigrationTestHelper =
MigrationTestHelper(
InstrumentationRegistry.getInstrumentation(),
AppDatabase::class.java,
emptyList(),
FrameworkSQLiteOpenHelperFactory(),
)

@Test
fun migrate12to13() {
Expand All @@ -31,15 +32,15 @@ class MigrationFrom12To13 {
db.use {
db.execSQL(
"""
INSERT INTO feeds(id, title, url, custom_title, tag, notify, last_sync, response_hash)
VALUES(1, 'feed', 'http://url', '', '', 0, 0, 666)
INSERT INTO feeds(id, title, url, custom_title, tag, notify, last_sync, response_hash)
VALUES(1, 'feed', 'http://url', '', '', 0, 0, 666)
""".trimIndent(),
)

db.execSQL(
"""
INSERT INTO feed_items(id, guid, title, plain_title, plain_snippet, unread, notified, feed_id, first_synced_time, primary_sort_time)
VALUES(8, 'http://item', 'title', 'ptitle', 'psnippet', 1, 0, 1, 0, 0)
INSERT INTO feed_items(id, guid, title, plain_title, plain_snippet, unread, notified, feed_id, first_synced_time, primary_sort_time)
VALUES(8, 'http://item', 'title', 'ptitle', 'psnippet', 1, 0, 1, 0, 0)
""".trimIndent(),
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ class MigrationFrom13To14 {

@Rule
@JvmField
val testHelper: MigrationTestHelper = MigrationTestHelper(
InstrumentationRegistry.getInstrumentation(),
AppDatabase::class.java,
emptyList(),
FrameworkSQLiteOpenHelperFactory(),
)
val testHelper: MigrationTestHelper =
MigrationTestHelper(
InstrumentationRegistry.getInstrumentation(),
AppDatabase::class.java,
emptyList(),
FrameworkSQLiteOpenHelperFactory(),
)

@Test
fun migrate13to14() {
Expand All @@ -31,15 +32,15 @@ class MigrationFrom13To14 {
db.use {
db.execSQL(
"""
INSERT INTO feeds(id, title, url, custom_title, tag, notify, last_sync, response_hash, fulltext_by_default)
VALUES(1, 'feed', 'http://url', '', '', 0, 0, 666, 0)
INSERT INTO feeds(id, title, url, custom_title, tag, notify, last_sync, response_hash, fulltext_by_default)
VALUES(1, 'feed', 'http://url', '', '', 0, 0, 666, 0)
""".trimIndent(),
)

db.execSQL(
"""
INSERT INTO feed_items(id, guid, title, plain_title, plain_snippet, unread, notified, feed_id, first_synced_time, primary_sort_time)
VALUES(8, 'http://item', 'title', 'ptitle', 'psnippet', 1, 0, 1, 0, 0)
INSERT INTO feed_items(id, guid, title, plain_title, plain_snippet, unread, notified, feed_id, first_synced_time, primary_sort_time)
VALUES(8, 'http://item', 'title', 'ptitle', 'psnippet', 1, 0, 1, 0, 0)
""".trimIndent(),
)
}
Expand Down
Loading