Last active
August 29, 2015 13:56
-
-
Save shadowhand/9160928 to your computer and use it in GitHub Desktop.
Search for external static deps using git grep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Git grep for external static deps (ignores static:: and self:: calls) | |
alias staticdeps="git grep -Pi '^(?!\s+[*\/]).+\b[a-z][a-z0-9_]++(?<!static|self)::'" | |
# can also be assigned as a git alias | |
# add --global if you want it everywhere | |
git config alias.extdeps "grep -Pi '^(?"'!'"\s+[*\/]).+\\b[a-z][a-z0-9_]++(?<"'!'"static|self)::'" | |
# usage, global search | |
git extdeps | |
# usage, specific path | |
git extdeps -- classes/foo.php | |
git extdeps -- vendor/zend |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment