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

Enable lint on test sources by default #436

Merged
merged 1 commit into from
Jun 30, 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
8 changes: 8 additions & 0 deletions slack-plugin/src/main/kotlin/slack/gradle/SlackProperties.kt
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,14 @@ public class SlackProperties private constructor(private val project: Project) {
public val lintBaselineFileName: String
get() = stringProperty("slack.lint.baseline-file-name", "lint-baseline.xml")

/** Flag to control whether or not lint checks test sources. */
public val lintCheckTestSources: Boolean
get() = booleanProperty("sgp.lint.checkTestSources", true)

/** Flag to control whether or not lint checks ignores test sources. */
public val lintIgnoreTestSources: Boolean
get() = booleanProperty("sgp.lint.ignoreTestSources", false)

/** Flag to enable/disable KSP. */
public val allowKsp: Boolean
get() = booleanProperty("slack.allow-ksp")
Expand Down
3 changes: 3 additions & 0 deletions slack-plugin/src/main/kotlin/slack/gradle/lint/LintTasks.kt
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ internal object LintTasks {
absolutePaths = false
this.checkDependencies = checkDependencies

ignoreTestSources = slackProperties.lintIgnoreTestSources
checkTestSources = slackProperties.lintCheckTestSources

val lintBaselineFile = slackProperties.lintBaselineFileName

// Lint is weird in that it will generate a new baseline file and fail the build if a new
Expand Down