Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tools/git/hooks/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ skip_lint="${SKIP_LINT_COMMIT}"
# Get the path to a file containing the commit message:
commit_message="$1"

# Determine root directory:
root=$(git rev-parse --show-toplevel)
# Determine git directory (resolves where `${root}/.git` is file OR directory):
Comment thread
kgryte marked this conversation as resolved.
Outdated
git_dir=$(git rev-parse --absolute-git-dir)

# Define the path to a report generated during the pre-commit hook:
pre_commit_report="${root}/.git/hooks-cache/pre_commit_report.yml"
pre_commit_report="${git_dir}/hooks-cache/pre_commit_report.yml"


# FUNCTIONS #
Expand Down
5 changes: 4 additions & 1 deletion tools/git/hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ skip_editorconfig="${SKIP_LINT_EDITORCONFIG}"
# Determine root directory:
root=$(git rev-parse --show-toplevel)

# Determine git directory (resolves where `${root}/.git` is file OR directory):
Comment thread
kgryte marked this conversation as resolved.
Outdated
git_dir=$(git rev-parse --absolute-git-dir)

# Define the path to a utility for linting filenames:
lint_filenames="${root}/lib/node_modules/@stdlib/_tools/lint/filenames/bin/cli"

Expand Down Expand Up @@ -81,7 +84,7 @@ cppcheck_tests_fixtures_suppressions_list="${root}/etc/cppcheck/suppressions.tes
cppcheck_benchmarks_suppressions_list="${root}/etc/cppcheck/suppressions.benchmarks.txt"

# Define the path to a directory for caching hook results:
cache_dir="${root}/.git/hooks-cache"
cache_dir="${git_dir}/hooks-cache"

# Define the path to a file for storing hook results:
cache_file="${cache_dir}/pre_commit_report.yml"
Expand Down
5 changes: 4 additions & 1 deletion tools/git/hooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ GIT_CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
# Determine root directory:
root=$(git rev-parse --show-toplevel)

# Determine git directory (resolves where `${root}/.git` is file OR directory):
Comment thread
kgryte marked this conversation as resolved.
Outdated
git_dir=$(git rev-parse --absolute-git-dir)

# Define the path to a directory for caching hook results:
cache_dir="${root}/.git/hooks-cache"
cache_dir="${git_dir}/hooks-cache"

# Define the path to a file for storing hook results:
cache_file="${cache_dir}/pre_push_report.yml"
Expand Down