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

Error: No lintable files found at paths: '' #5850

Open
2 tasks done
ryansalisbury opened this issue Nov 8, 2024 · 1 comment
Open
2 tasks done

Error: No lintable files found at paths: '' #5850

ryansalisbury opened this issue Nov 8, 2024 · 1 comment
Labels
help Questions or user problems that require more explanation rather than code changes.

Comments

@ryansalisbury
Copy link

ryansalisbury commented Nov 8, 2024

New Issue Checklist

Bug Description

I have followed the installation instructions from the github readMe, and when I run swiftlint form the terminal, it correctly outputs the field with linting warnings/errors in them. However, when I add the build script to the Build Phase as 'SwiftLint'm using the bash code found in the ReadME, I consistently get this error:

Linting Swift files in current working directory
Error: No lintable files found at paths: ''
Command PhaseScriptExecution failed with a nonzero exit code

Mention the command or other SwiftLint integration method that caused the issue. Include stack traces or command output.

Linting Swift files in current working directory
Error: No lintable files found at paths: ''
Command PhaseScriptExecution failed with a nonzero exit code

Environment

  • SwiftLint version (run swiftlint version to be sure)
  • 0.57.0
  • Xcode version (run xcodebuild -version to be sure)
  • Xcode 16.1
  • Build version 16B40
  • Installation method used (Homebrew, CocoaPods, building from source, etc)
  • I used HomeBrew to install swiftlint
  • Configuration file:
I do not have a yml file set-up for configurations since I am just installing swiftlint for the first time.```

Are you using [nested configurations](https://github.com/realm/SwiftLint#nested-configurations)? If so, paste their
relative paths and respective contents.
I am not using nested configurations - i am just starting a swift project for the first time and am surprised that Swift does not have a plugin like 'Prettier' for VSCode.
@SimplyDanny SimplyDanny added the help Questions or user problems that require more explanation rather than code changes. label Nov 10, 2024
@vdhamer
Copy link

vdhamer commented Nov 27, 2024

Changing the Build Settings > Build Options > User Script Sandboxing to "No" should fix it.

I am running Xcode 16.2 beta 3 (16C5023f) and SwiftLint 0.57.1 (installed as a final build step) and just ran into this in a fresh project with 100 or so lines of Swift. So it should also show up in Apple's own "hello world" file templates.

This issue is not new: #5053. But the triggered Xcode error messages have somehow changed over the past 1.5 years.

What’s apparently going on here is that SwiftLint needs to discover and read the source files for scanning. And - due to sandboxing restrictions - is not allowed to see or read those files. Sandboxing can be seen as a layer on top of the Unix access privileges and causes files that are clearly present (e.g. to ls -al) to be invisible to an app even when the access privileges are set to 777.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help Questions or user problems that require more explanation rather than code changes.
Projects
None yet
Development

No branches or pull requests

3 participants