Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/automation-co/husky
/ functions
Functions
29 in github.com/automation-co/husky
⨍
Functions
29
◇
Types & classes
0
↓ 10 callers
Function
getRepoPath
getRepoPath is a testing utility function to create a random directory and return its path
internal/lib/lib_test.go:24
↓ 7 callers
Function
setupRepo
setupRepo creates a git repository in the path
internal/lib/lib_test.go:34
↓ 3 callers
Function
Install
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 callers
Function
getHuskyHooksDir
getHuskyHooksDir will return the relative or absolute .husky hooks directory
internal/lib/utils.go:71
↓ 3 callers
Function
gitExists
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 callers
Function
huskyExists
huskyExists will return true if exists, otherwise false TODO: support recursive find .husky directory till home
internal/lib/utils.go:58
↓ 2 callers
Function
randomString
randomString returns a random string of a specific length
internal/lib/lib_test.go:46
↓ 1 callers
Function
Add
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 callers
Function
Execute
()
cmd/root.go:19
↓ 1 callers
Function
Init
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 callers
Function
contains
contains will return true if str exists in s
internal/lib/utils.go:27
↓ 1 callers
Function
getGitHooksDir
getGitHooksDir will return the relative or absolute .git hooks directory
internal/lib/utils.go:81
↓ 1 callers
Function
isValidHook
isValidHook will call the contains function internally.
internal/lib/utils.go:38
Function
TestAdd
TestAddNoHusky validates if the lib.Add() returns error if husky is not initialized
internal/lib/lib_test.go:125
Function
TestAddInvalidHook
TestAddInvalidHook validates that the lib.Add() will return error when invalid hook name is provided
internal/lib/lib_test.go:63
Function
TestAddNoGit
TestAddNoGit validates that the lib.Add() will return error when git is not initialized
internal/lib/lib_test.go:74
Function
TestAddNoHusky
TestAddNoHusky validates if the lib.Add() returns error if husky is not initialized
internal/lib/lib_test.go:102
Function
TestInit
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
Function
TestInitHuskyExists
TestAddNoHusky validates if the lib.Add() returns error if husky is not initialized
internal/lib/lib_test.go:189
Function
TestInitNoGit
TestInitNoGit validates that the lib.Init() will return error when git is not initialized
internal/lib/lib_test.go:161
Function
TestInstall
TestInstall validates everything lib.Install() has done is correct
internal/lib/lib_test.go:334
Function
TestInstallNoGit
TestInstallNoGit validates that the lib.Install() will return error when git is not initialized
internal/lib/lib_test.go:256
Function
TestInstallNoHusky
TestInstallNoHusky validates if the lib.Install() returns error if husky is not initialized
internal/lib/lib_test.go:284
Function
TestInstallNoHuskyHooks
TestInstallNoHuskyHooks validates if lib.Install() returns error when .husky/hooks directory doesn't exists
internal/lib/lib_test.go:307
Function
init
()
cmd/init.go:24
Function
init
()
cmd/install.go:19
Function
init
()
cmd/root.go:26
Function
init
()
cmd/add.go:32
Function
main
()
main.go:5