Swiftlint unable to open configuration file

1.7k Views Asked by At

I installed swiftlint through brew

brew install swiftlint

verified successfull installation through

swiftlint --version
0.50.1

Added script to project

export PATH="$PATH:/opt/homebrew/bin"
if which swiftlint >/dev/null; then
  echo "SwiftLint started"
  swiftlint
else
  echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi

Also i have:
root project:
-> .swiftlint.yml

When i'm trying to build project I'm getting

Swiftlint error message

Tried also
swiftlint lint --config project/.swiftlint.yml

Update: After several mac restarts somehow after time it is fixed

2

There are 2 best solutions below

0
patrikbelis On BEST ANSWER

Update: After several mac restarts somehow after time it is fixed

0
GayleDDS On

In my case, I didn't have read permission for the swiftlint.yml in my Swift Package. I solved it by adding the swiftlint.yml file to the sources list in my Target.