Skip to content

additionalEditorconfigFile Property deprecation handling and its Direct Usage in getEditorConfigFiles #840

@vanessamj99

Description

@vanessamj99

Hello!

I'm exploring the ktlint-gradle plugin codebase to better understand its behavior and how to incorporate the Gradle Problems API integration.

I've notice that the additionalEditorconfigFile property in BaseKtlintCheckTask.kt is marked as deprecated:

@get:Internal
@get:Deprecated("ktlint no longer supports this parameter")
internal abstract val additionalEditorconfigFile: RegularFileProperty

and it is being used in the getEditorConfigFiles function in PluginUtil.kt:

internal fun getEditorConfigFiles(
    currentProjectDir: Path,
    additionalEditorconfigFile: RegularFileProperty
): Set<Path> {
    val result = mutableSetOf<Path>()
    searchEditorConfigFiles(
        currentProjectDir,
        result
    )

    if (additionalEditorconfigFile.isPresent) {
        result.add(
            additionalEditorconfigFile.asFile.get().toPath()
        )
    }

    return result
}

Despite being marked as deprecated with the message "ktlint no longer supports this parameter", the code still uses the property in getEditoryConfigFiles to construct a result. This creates some inconsistency and can lead to unexpected confusion for users. To improve maintainability of the plugin and clarity, what are your thoughts on removing the additionalEditorconfigFile property and the check in getEditorConfigFiles.

Thank you for your time!

-Vanessa

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions