SwiftLint on a Swift Package

I'm trying to run SwiftLint on a Swift package. I have installed SwiftLint via mint. From the root of my project directory I can run mint run swiftlint, and this lints my project correctly.

As a next step, I would like this automated with the errors/warnings showing up in Xcode. I've tried

  1. Editing Package.swift, and adding SwiftLint as a package dependency and a plugin on target. While this shows me the errors/warnings in Xcode, it does not process my .swiftlint.yml file.

  2. Editing my scheme, and then adding a run script to my pre (have also tried post) build actions. While this runs the linting (and honors my .swiftlint.yml), it does not show the issues in Xcode. My script is

# Type a script or drag a script file from your workspace to insert its path.
export PATH="$PATH:/opt/homebrew/bin"
if mint which realm/swiftlint > /dev/null; then
  cd "$WORKSPACE_PATH/../../.."
  mint run realm/swiftlint
  echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"

What would be a good way to lint a swift package?