slackhq / slack-lints

A collection of custom Android/Kotlin lint checks we use in our Android and Kotlin code bases at Slack.
Apache License 2.0
218 stars 10 forks source link

Load external denylist entries via ServiceLoader #261

Open erawhctim opened 3 months ago

erawhctim commented 3 months ago

Summary

Allow consumers to supply their own DenyListedEntrys via a ServiceLoader interface. Fixes #241.

Open to suggestions on any of the names, or if there's a preferred use of ServiceLoader (it's new to me!)

Requirements (place an x in each [ ])

The following point can be removed after setting up CI (such as Travis) with coverage reports (such as Codecov)

The following point can be removed after setting up a CLA reporting tool such as cla-assistant.io

erawhctim commented 3 months ago

when running spotlessApply locally, I hit an error that I'm not sure what to do with. Subsequent spotless runs seemed to want to delete various files in my staging area 🤔 Have you run into this before?

> Task :spotlessKotlinExternalApply FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':spotlessKotlinExternalApply'.
> java.nio.file.FileAlreadyExistsException: /Users/mitchware/Desktop/Workspace/erawhctim-slack-lints/build/spotless/spotlessKotlinExternal/slack-lint-checks/src/test/java/slack/lint/denylistedapis/TestEntriesLoader.kt -> /Users/mitchware/Desktop/Workspace/erawhctim-slack-lints/slack-lint-checks/src/test/java/slack/lint/denylistedapis/TestEntriesLoader.kt

Same issue happened with the DenyListedEntryLoader interface.

ZacSweers commented 2 months ago

For the spotless issue, just re-run it again without configuration cache. It's a weird issue with spotless that I don't really understand :/