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

0.24.0 issues with folder names #1948

Closed
123kyky opened this Issue Nov 15, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@123kyky

123kyky commented Nov 15, 2017

New Issue Checklist

Bug Report

Complete output when running SwiftLint, including the stack trace and command used

Partial output, sorry. Full output is huge

Linting 'GRMustache.swift' (96/858)
error opening input file 'path/.../GRMustache.swift' (Is a directory)
Most rules will be skipped because sourcekitd has failed.
Linting 'ViewController.swift' (97/858)
Linting 'AppDelegate.swift' (98/858)
Linting 'OSXTests.swift' (99/858)
Linting 'iOSTests.swift' (100/858)
Linting 'ViewController.swift' (101/858)
Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=NSCocoaErrorDomain Code=257 "The file “GRMustache.swift” couldn’t be opened because you don’t have permission to view it." UserInfo={NSFilePath=path/.../GRMustache.swift, NSUnderlyingError=0x7f90e4299ff0 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}}: file /BuildRoot/Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-900.0.69.2/src/swift/stdlib/public/core/ErrorType.swift, line 181
Illegal instruction: 4

Environment

0.24.0
homebrew

Pulled from config

excluded:
  - GRMustache.swift
  - MKCommon/Theming/Fonts/FontAwesome.swift

Latest xcode 9 build
No example, sorry

My report

It appears that swift lint is ignoring some folders now in the excluded config because of the directory name containing a "."
For example:
GRMustache.swift/
FontAwesome.swift/

It looks like swiftlint is having trouble opening this directory because its treating it as a file anyway, though it appears that my exclusion in our config file is being ignored. Anyone else experiencing this as of updating?

@marcelofabri

This comment has been minimized.

Collaborator

marcelofabri commented Nov 28, 2017

Can you please provide a sample project/example to make it easier to test? Thanks!

@marcelofabri marcelofabri added the bug label Nov 28, 2017

@jerekapyaho

This comment has been minimized.

jerekapyaho commented Nov 30, 2017

Just stumbled upon this with GRDB.swift -- same error, also 0.24.0. Pods directory was excluded in .swiftlint.yml.

Minimal test would be:

  • Create a new iOS project
  • Do pod init
  • Add pod 'GRDB.swift' and pod 'SwiftLint' to Podfile
  • Do pod install
  • Add exclude: - Pods to .swiftlint.yml
  • Open workspace
  • Add Run Build Script phase for swiftlint
  • Build project
@123kyky

This comment has been minimized.

123kyky commented Dec 1, 2017

Here is a very simple recreation. Just two swift files, a swiftlint config, and a folder with ".swift" in the name. Uncompress and run "swiftlint" in terminal within the new folder.
SwiftLintFolderNamesTest.zip

@marcelofabri

This comment has been minimized.

Collaborator

marcelofabri commented Feb 12, 2018

Fixed in #2047.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment