Skip to content

pre-commit hook failed (add --no-verify to skip) #57

@suddenly1990

Description

@suddenly1990

when I create a project,and I add package.swift for project.

here is package.swift code:

`

import PackageDescription
let package = Package(
name: "LearningGitHook",
dependencies: [
.package(url: "https://github.com/shibapm/Komondor.git", from: "1.0.0")
],
targets: [
.target(name: "LearningGitHook", dependencies: [], path: "LearningGitHook"),
]
)
#if canImport(PackageConfig)
import PackageConfig
let config = PackageConfiguration([
"komondor": [
"pre-commit": [
"swift test",
"swift run swiftFormat .",
"swift run swiftlint autocorrect --path LearningGitHook/",
"git add ."
],
"pre-push": [
"swift test",
"swift run danger-swift local",
"swift run swiftlint"
]
],
]).write()
#end

`

when I commite code I get this error:

[Komondor] > pre-commit swift test
error: fatalError
[1/1] Planning build
[1/3] Compiling LearningGitHook AppDelegate.swift
/Users/daibaisheng/Desktop/LearningGitHook/LearningGitHook/AppDelegate.swift:8:8: error: no such module 'UIKit'
import UIKit
^
[2/3] Compiling LearningGitHook SceneDelegate.swift
/Users/daibaisheng/Desktop/LearningGitHook/LearningGitHook/AppDelegate.swift:8:8: error: no such module 'UIKit'
import UIKit
^
[3/3] Compiling LearningGitHook ViewController.swift
/Users/daibaisheng/Desktop/LearningGitHook/LearningGitHook/AppDelegate.swift:8:8: error: no such module 'UIKit'
import UIKit
^
[Komondor] > pre-commit hook failed (add --no-verify to skip)

what reason for this error,and what should I do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions