danielhoherd / pre-commit-hooks Goto Github PK
View Code? Open in Web Editor NEWA collection of pre-commit hooks I use in most of my repositories.
License: MIT License
A collection of pre-commit hooks I use in most of my repositories.
License: MIT License
Write a python tool to parse commands out of circleci, write them to files, and run them through shellcheck. This will probably require using the circleci config validate
command, which may be impractical. An alternative may be to abort when << circleci.variable >>
type interpolations are encountered.
Add a hook to replace unicode quotes with normal quotes. EG:
$ cat ~/code/dho-bin/fix-shitty-quotes.sh
#!/usr/bin/env bash
# shellcheck disable=SC1111
# Purpose: Remove unicode quotes from content.
# Caveats: This is just a dump search/replace. It does not account for quoted
# content that will be misquoted after removing unicode quotes.
if [ "${#@}" -lt 1 ]; then
echo "Replaces shitty quotes with normal quotes in all given files"
echo "example: grep -rl '[“”’]' | xargs ${0##*/}"
exit 1
fi
if [ "$(uname)" == 'Darwin' ]; then
[ ! -e /usr/local/bin/gsed ] && {
echo "GNU sed is required because bsd sed is lame."
exit 1
}
/usr/local/bin/gsed -i 's/[“”]/"/g' "$@"
/usr/local/bin/gsed -i "s/’/'/g" "$@"
else
sed -i 's/[“”]/"/g' "$@"
sed -i "s/’/'/g" "$@"
fi
A tool to report when tiny files are being added. Checks for line count, or character count. Maybe one hook for each. This will help people avoid committing empty files or files with truncated data that were supposed to be deleted.
pre-commit-hooks/.pre-commit-hooks.yaml
Line 29 in 1584d0b
Because of the xargs style running of the script, any nested .gitignore files get merged in to the git root .gitignore file. We need to find a way to support args and also allow xargs style behavior.
Add a flynt hook. Super easy.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.