SwiftLint: Problem when SwiftLint loads ".swiftlint.yml"

Hello every one!

I am having problem with SwiftLint at version 0.7.2 and I can’t build my project on Xcode 7.2, when I include the “.swiftlint.yml” file at the root of project, the follow message appears

Loading configuration from '.swiftlint.yml'
No lintable files found at path ''
Command /bin/sh failed with exit code 1

But build the project without the file “.swiftlint.yml” run right, but I need specify some rules.

Any clues on what this issue might be?

Thanks for all!!!

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 22
  • Comments: 18

Most upvoted comments

I just updated to xcode 10.2 and surprisingly ran into this problem, even with the default config file.

What helped for me was to comment out the Sources directory in the config file, like so:

included: # paths to include during linting. `--path` is ignored if present.
#  - Source

Commenting - Source solve this issue here.

What’s the contents of your Source directory? Are there Swift files in Source other than in ExcludedFolder or ExcludedFile.swift?

Reproduced this problem when a project has spaces in the name/path. If the spaces are removed, it works fine.

I just uninstalled and reinstalled it via brew (with still the same .swiftlint.yml file in place) and now it works.

@jpsim Sure. Create a new project, name it something like “Test Project”. In the .swiftlint.yml, add/replace these lines (or something similar referencing the path with spaces):

included: 
  - Test\ Project

excluded: 
   - Test\ Project/AppDelegate.swift

SwiftLint will give you the error referenced above now. It will run if the spaces are removed in the project path/folders, or if you remove the included/excluded configuration.