1
0
mirror of https://github.com/sasjs/core.git synced 2025-12-10 14:04:36 +00:00

fix: remove .githooks now we have sasjs lint

This commit is contained in:
2021-04-03 21:54:50 +02:00
parent 7dec3120be
commit cb8992dade
3 changed files with 12 additions and 57 deletions

View File

@@ -1,44 +0,0 @@
#!/bin/bash
#
# A hook script to verify that no filenames with capital letters are committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# Go through all the changed files (except for deleted and unmerged)
# Save exit code of last executed action
exit_code=0
# Check if file is one of SAS|DDL|CSV|SH and check for uppercase letters
mime_pattern="\.(sas|ddl|csv|sh)"
# Check for capital letters only in file names
extra_pattern="(^|/)[^/]*([A-Z]+)[^/]*\.[A-Za-z]{3}$"
# Grep git diff of files to commit
files=$( git diff --cached --find-copies --find-renames --name-only --diff-filter=ACMRTXBU |
grep -Ei "$mime_pattern" |
grep -E "$extra_pattern" )
echo "$files"
if [[ -n "$files" ]];
then
echo
echo "Found files that contain capital letters."
echo "Please rename the following files in lowercase, and commit again:"
for file in $files; do
echo -e '- \E[0;32m'"$file"'\033[0m'
done
# Abort commit
exit_code=1
fi
if [ "$exit_code" == "0" ]; then
echo
echo -e '\033[1m'"Pre-commit validation Passed"'\033[0m'
echo
else
echo
echo -e '\033[1m'"Commit Aborted!"'\033[0m'
echo
fi
exit $exit_code

22
package-lock.json generated
View File

@@ -304,6 +304,14 @@
"dev": true,
"requires": {
"colors": "1.0.3"
},
"dependencies": {
"colors": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz",
"integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=",
"dev": true
}
}
},
"clone": {
@@ -328,9 +336,9 @@
"dev": true
},
"colors": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz",
"integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=",
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz",
"integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=",
"dev": true
},
"combined-stream": {
@@ -568,14 +576,6 @@
"requires": {
"colors": "~0.6.0-1",
"commander": "~2.1.0"
},
"dependencies": {
"colors": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz",
"integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=",
"dev": true
}
}
},
"follow-redirects": {

View File

@@ -28,8 +28,7 @@
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"docs": "sasjs doc && ./sasjs/utils/build.sh",
"postinstall": "node-git-hooks"
"docs": "sasjs doc && ./sasjs/utils/build.sh"
},
"devDependencies": {
"@sasjs/cli": "^2.14.2",