mirror of
https://github.com/sasjs/core.git
synced 2026-01-15 12:30:06 +00:00
fix: remove .githooks now we have sasjs lint
This commit is contained in:
@@ -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
22
package-lock.json
generated
@@ -304,6 +304,14 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"colors": "1.0.3"
|
"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": {
|
"clone": {
|
||||||
@@ -328,9 +336,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"colors": {
|
"colors": {
|
||||||
"version": "1.0.3",
|
"version": "0.6.2",
|
||||||
"resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz",
|
||||||
"integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=",
|
"integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"combined-stream": {
|
"combined-stream": {
|
||||||
@@ -568,14 +576,6 @@
|
|||||||
"requires": {
|
"requires": {
|
||||||
"colors": "~0.6.0-1",
|
"colors": "~0.6.0-1",
|
||||||
"commander": "~2.1.0"
|
"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": {
|
"follow-redirects": {
|
||||||
|
|||||||
@@ -28,8 +28,7 @@
|
|||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"docs": "sasjs doc && ./sasjs/utils/build.sh",
|
"docs": "sasjs doc && ./sasjs/utils/build.sh"
|
||||||
"postinstall": "node-git-hooks"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sasjs/cli": "^2.14.2",
|
"@sasjs/cli": "^2.14.2",
|
||||||
|
|||||||
Reference in New Issue
Block a user