Lona / Lona

A tool for defining design systems and using them to generate cross-platform UI code, Sketch files, and other artifacts.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[SwiftLint] Pre-commit hooks fails on files with spaces in path

dabbott opened this issue · comments

This is easy to workaround, so not a big deal, but good to fix at some point.

We had a directory called Inspector View, which then produces a nonexistant path in the SwiftLint script. Probably there needs to be a quoted string somewhere, but I didn't look into where. It could also be a problem in SwiftLint itself.

devinabbott:~/Projects/Lona/studio • git commit -m "Add inspector view to header"
  ↓ Stashing changes... [skipped]
    → No partially staged files found...
  ❯ Running linters...
    ❯ Running tasks for *.swift
      ✖ ./scripts/pre-commit-swiftlint.sh
    ↓ Running tasks for *.{js,jsx} [skipped]
      → No staged files match *.{js,jsx}
    ↓ Running tasks for *.md [skipped]
      → No staged files match *.md



✖ ./scripts/pre-commit-swiftlint.sh found some errors. Please fix them and try committing again.
2
Found lintable files! Linting...

Violation found of the type ERROR! Must fix before commit!

Loading configuration from '.swiftlint.yml'
Linting 'InspectorView.swift' (1/1)
error opening input file '/Users/devinabbott/Projects/Lona/studio/View/InspectorView.swift' (No such file or directory)
Most rules will be skipped because sourcekitd has failed.
Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=NSCocoaErrorDomain Code=260 "The file “InspectorView.swift” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/devinabbott/Projects/Lona/studio/View/InspectorView.swift, NSUnderlyingError=0x7fbd0e552160 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}: file /BuildRoot/Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-900.0.74.1/src/swift/stdlib/public/core/ErrorType.swift, line 181
./scripts/pre-commit-swiftlint.sh: line 41: 13100 Illegal instruction: 4  $SWIFT_LINT lint --use-script-input-files --config .swiftlint.yml
pre-commit: 
pre-commit: We've failed to pass the specified git pre-commit hooks as the `lint-staged`
pre-commit: hook returned an exit code (1). If you're feeling adventurous you can
pre-commit: skip the git pre-commit hooks by adding the following flags to your commit:
pre-commit: 
pre-commit:   git commit -n (or --no-verify)
pre-commit: 
pre-commit: This is ill-advised since the commit is broken.
pre-commit: