MCPcopy Create free account

hub / github.com/automation-co/husky / functions

Functions29 in github.com/automation-co/husky

↓ 10 callersFunctiongetRepoPath
getRepoPath is a testing utility function to create a random directory and return its path
internal/lib/lib_test.go:24
↓ 7 callersFunctionsetupRepo
setupRepo creates a git repository in the path
internal/lib/lib_test.go:34
↓ 3 callersFunctionInstall
Install command will iterate the files from .husky/hooks create the hardlinks into .git/hooks and chmod to 0755 permission. The function intend to fai
internal/lib/install.go:12
↓ 3 callersFunctiongetHuskyHooksDir
getHuskyHooksDir will return the relative or absolute .husky hooks directory
internal/lib/utils.go:71
↓ 3 callersFunctiongitExists
gitExists will return true if the comman is executed under .git directory TODO: support recursive find .git directory till home
internal/lib/utils.go:44
↓ 3 callersFunctionhuskyExists
huskyExists will return true if exists, otherwise false TODO: support recursive find .husky directory till home
internal/lib/utils.go:58
↓ 2 callersFunctionrandomString
randomString returns a random string of a specific length
internal/lib/lib_test.go:46
↓ 1 callersFunctionAdd
Add command will create the file from hook value into .husky/hooks directory. The cmd appended to shebang string and written in the file .husky/hooks/
internal/lib/add.go:12
↓ 1 callersFunctionExecute
()
cmd/root.go:19
↓ 1 callersFunctionInit
Init command will set up the .husky directory as sibling of .git directory if not exists install pre-commit hook by default If .husky exists, it will
internal/lib/init.go:11
↓ 1 callersFunctioncontains
contains will return true if str exists in s
internal/lib/utils.go:27
↓ 1 callersFunctiongetGitHooksDir
getGitHooksDir will return the relative or absolute .git hooks directory
internal/lib/utils.go:81
↓ 1 callersFunctionisValidHook
isValidHook will call the contains function internally.
internal/lib/utils.go:38
FunctionTestAdd
TestAddNoHusky validates if the lib.Add() returns error if husky is not initialized
internal/lib/lib_test.go:125
FunctionTestAddInvalidHook
TestAddInvalidHook validates that the lib.Add() will return error when invalid hook name is provided
internal/lib/lib_test.go:63
FunctionTestAddNoGit
TestAddNoGit validates that the lib.Add() will return error when git is not initialized
internal/lib/lib_test.go:74
FunctionTestAddNoHusky
TestAddNoHusky validates if the lib.Add() returns error if husky is not initialized
internal/lib/lib_test.go:102
FunctionTestInit
TestInit validates if the lib.Init() function runs accurately or not. It will skip the testing of the lib.Install() function in the end.
internal/lib/lib_test.go:217
FunctionTestInitHuskyExists
TestAddNoHusky validates if the lib.Add() returns error if husky is not initialized
internal/lib/lib_test.go:189
FunctionTestInitNoGit
TestInitNoGit validates that the lib.Init() will return error when git is not initialized
internal/lib/lib_test.go:161
FunctionTestInstall
TestInstall validates everything lib.Install() has done is correct
internal/lib/lib_test.go:334
FunctionTestInstallNoGit
TestInstallNoGit validates that the lib.Install() will return error when git is not initialized
internal/lib/lib_test.go:256
FunctionTestInstallNoHusky
TestInstallNoHusky validates if the lib.Install() returns error if husky is not initialized
internal/lib/lib_test.go:284
FunctionTestInstallNoHuskyHooks
TestInstallNoHuskyHooks validates if lib.Install() returns error when .husky/hooks directory doesn't exists
internal/lib/lib_test.go:307
Functioninit
()
cmd/init.go:24
Functioninit
()
cmd/install.go:19
Functioninit
()
cmd/root.go:26
Functioninit
()
cmd/add.go:32
Functionmain
()
main.go:5