Skip to content

Commit 14a51e1

Browse files
committed
Drop automatic checking script in favor of pre-commit; setup-dev-env fixes
Signed-off-by: 林博仁(Buo-ren Lin) <[email protected]>
1 parent ea8169c commit 14a51e1

5 files changed

+6
-36
lines changed

.gitmodules

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
path = Git Clean and Smudge Filters/Clean Filter for GNU Bash Scripts
33
url = https://github.com/Lin-Buo-Ren/Clean-Filter-for-GNU-Bash-Scripts.git
44
ignore = all
5-
[submodule "Linters/GNU Bash Automatic Checking Program for Git Projects"]
6-
path = Linters/GNU Bash Automatic Checking Program for Git Projects
7-
url = https://github.com/Lin-Buo-Ren/GNU-Bash-Automatic-Checking-Program-for-Git-Projects
8-
fetchRecurseSubmodules = no
9-
ignore = all
105
[submodule "Continuous Integration/Utilities for Travis CI"]
116
path = Continuous Integration/Utilities for Travis CI
127
url = https://github.com/Lin-Buo-Ren/Utilities-for-Travis-CI.git
Lines changed: 0 additions & 1 deletion
This file was deleted.

Linters/SOFTWARE_DIRECTORY_CONFIGURATION.source

Lines changed: 0 additions & 1 deletion
This file was deleted.

SOFTWARE_DIRECTORY_CONFIGURATION.source

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,5 @@
88
# SDC_TEMP_DIR="${SHC_PREFIX_DIR}/Temporary Files"
99
SDC_KDE_TEMPLATE_SETUP_DIR="${SHC_PREFIX_DIR}/Template Setup for KDE"
1010
SDC_SOURCE_CODE_DIR="${SHC_PREFIX_DIR}/Source Code"
11-
SDC_GIT_HOOKS_DIR="${SHC_PREFIX_DIR}/Git Hooks"
1211
SDC_RELEASE_DIR="${SHC_PREFIX_DIR}/Software Release"
1312
SDC_GIT_FILTERS_DIR="${SHC_PREFIX_DIR}/Git Clean and Smudge Filters"
14-
SDC_LINTERS_DIR="${SHC_PREFIX_DIR}/Linters"

setup-development-environment.bash

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ declare -Ar META_RUNTIME_DEPENDENCIES_CRITICAL=(
6565
)
6666

6767
### These are the dependencies that are used later and also checked later
68-
declare -Ar META_RUNTIME_DEPENDENCIES=()
68+
declare -Ar META_RUNTIME_DEPENDENCIES=(
69+
[pre-commit]="pre-commit - A framework for managing and maintaining multi-language pre-commit hooks"
70+
)
6971
## #################### End of META_RUNTIME_DEPENDENCIES ######################
7072

7173
### Program's Commandline Options Definitions
@@ -96,16 +98,10 @@ init() {
9698

9799
printf 'Fetching submodules..'
98100
# shellcheck disable=SC1090
99-
source "${SDC_GIT_HOOKS_DIR}/SOFTWARE_DIRECTORY_CONFIGURATION.source"
100-
# shellcheck disable=SC1090
101101
source "${SDC_GIT_FILTERS_DIR}/SOFTWARE_DIRECTORY_CONFIGURATION.source"
102-
# shellcheck disable=SC1090
103-
source "${SDC_LINTERS_DIR}/SOFTWARE_DIRECTORY_CONFIGURATION.source"
104102
git submodule init\
105-
"${SDC_GIT_PRECOMMIT_HOOK_FOR_BASH_DIR}"\
106-
"${SDC_BASH_AUTOMATIC_CHECKING_FOR_GIT}"\
107103
"${SDC_CLEAN_FILTER_FOR_BASH_DIR}"
108-
git submodule update
104+
git submodule update --depth=30
109105
local GIT_DIR_OLD="${GIT_DIR}"
110106
local GIT_WORK_TREE_OLD="${GIT_WORK_TREE}"
111107
GIT_DIR="${SDC_CLEAN_FILTER_FOR_BASH_DIR}/.git"
@@ -120,24 +116,7 @@ init() {
120116
printf 'done\n'
121117

122118
printf 'Setting pre-commit hook...'
123-
if ! [ -v SDC_GIT_HOOKS_DIR ]; then
124-
printf '%s: Error: Unable to locate Git Hooks directory' "${RUNTIME_SCRIPT_FILENAME}" 1>&2
125-
exit 1
126-
fi
127-
# SOFTWARE_DIRECTORY_CONFIGURATION.source is scope of Flexible Software Installation Specification
128-
# shellcheck disable=SC1090
129-
if ! [ -v SDC_GIT_PRECOMMIT_HOOK_FOR_BASH_DIR ]\
130-
|| [ -z "${SDC_GIT_PRECOMMIT_HOOK_FOR_BASH_DIR}" ]; then
131-
printf '%s: Error: Unable to locate Git Precommit Hooks for Bash directory' "${RUNTIME_SCRIPT_FILENAME}" 1>&2
132-
exit 1
133-
fi
134-
ln\
135-
--symbolic\
136-
--relative\
137-
--force\
138-
"${SDC_GIT_PRECOMMIT_HOOK_FOR_BASH_DIR}/Git Pre-commit Hook for GNU Bash Projects.bash"\
139-
"${SHC_PREFIX_DIR}"/.git/hooks/pre-commit\
140-
&& printf 'done\n'
119+
pre-commit install
141120

142121
printf 'Setting project-specific git configurations...'
143122
git config include.path ../.gitconfig && printf 'done.\n'
@@ -860,7 +839,7 @@ meta_fsis_setup_application_metadata
860839

861840
## This script is based on the GNU Bash Shell Script Template project
862841
## https://github.com/Lin-Buo-Ren/GNU-Bash-Shell-Script-Template
863-
## and is based on the following version:
842+
## and is based on the following version:
864843
## GNU_BASH_SHELL_SCRIPT_TEMPLATE_VERSION=@@GBSST_VERSION@@
865844
## You may rebase your script to incorporate new features and fixes from the template
866845

0 commit comments

Comments
 (0)