github facebook/ktfmt v0.36
0.36

latest releases: v0.56, v0.55, v0.54...
3 years ago

Style change examples:

Before: (notice as)

   bitmapMemoryCacheParamsSupplier =
        builder.bitmapMemoryCacheParamsSupplier
            ?: DefaultBitmapMemoryCacheParamsSupplier(
                (checkNotNull(builder.context.getSystemService(Context.ACTIVITY_SERVICE)) as
                    ActivityManager))

After:

    bitmapMemoryCacheParamsSupplier =
        builder.bitmapMemoryCacheParamsSupplier
            ?: DefaultBitmapMemoryCacheParamsSupplier(
                (checkNotNull(builder.context.getSystemService(Context.ACTIVITY_SERVICE))
                    as ActivityManager))

Before: (notice imports)

    importCleanUpCandidates =
        importList
            .imports
            .filter { import ->
              import.isValidImport &&
                  !import.isAllUnder &&
                  import.identifier != null &&
                  requireNotNull(import.identifier) !in OPERATORS &&
                  !COMPONENT_OPERATOR_REGEX.matches(import.identifier.orEmpty())
            }
            .toSet()

After:

    importCleanUpCandidates =
        importList.imports
            .filter { import ->
              import.isValidImport &&
                  !import.isAllUnder &&
                  import.identifier != null &&
                  requireNotNull(import.identifier) !in OPERATORS &&
                  !COMPONENT_OPERATOR_REGEX.matches(import.identifier.orEmpty())
            }
            .toSet()

Changelist:

Don't miss a new ktfmt release

NewReleases is sending notifications on new releases.