We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please comment below! Comments will automatically be published on the blog, too.
The text was updated successfully, but these errors were encountered:
I usually put a precommit hook checking that kind of things and disallowing pushing.
Here's the hook :
#!/usr/bin/env bash LC_ALL=C # blacklist check echo "Checking blacklisted words additions ..." currentBranch=$(git rev-parse --abbrev-ref HEAD) searchBlacklistedWords=$(git diff --diff-filter=ACMRT origin/$currentBranch | egrep '^\+' | egrep '(@wip|print\s{1}last|\s{1}dd\(|\s{1}dump\(|\s{1}var_dump\(|\s{1}exit|\s{1}die)+') hasBlacklistedWord=$(echo "$searchBlacklistedWords" | tr -d '[:space:] ' | wc -w) if [[ $hasBlacklistedWord > 0 ]]; then echo "Blacklisted words were found ! Details :" echo "$searchBlacklistedWords" exit 1 fi echo "Great job! No blacklisted words were found !"
Sorry, something went wrong.
Awesome tips. Cheers both!
If you are using PHP-CS-Fixer, another option would be to use this (risky) fixer that removes all calls to dump() and other debug statements: https://github.com/akovalyov/DebugStatementsFixers
dump()
I accidentally pushed a dump() statement to production once, and this fixer now runs in the CI pipeline.
No branches or pull requests
Please comment below!
Comments will automatically be published on the blog, too.
The text was updated successfully, but these errors were encountered: