Skip to content

Commit

Permalink
Adding a custom pre-commit hook, and a new script which sets up the
Browse files Browse the repository at this point in the history
hook.
  • Loading branch information
codetalker7 committed Sep 2, 2023
1 parent 5b39a34 commit 1327c1c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
julia --color=yes dev/flux_format.jl --verbose .
2 changes: 2 additions & 0 deletions dev/Project.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
[deps]
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
Git = "d7ba0133-e1db-5d97-8f8c-041e4b3a1eb2"
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
9 changes: 9 additions & 0 deletions dev/setup.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# setup the custom git hook
using Git

# set the local hooks path
const git = Git.git()
run(`$git config --local core.hooksPath .githooks/`)

# set file permission for hook
Base.Filesystem.chmod(".githooks", 0o777; recursive = true)

0 comments on commit 1327c1c

Please sign in to comment.