farmerli / codesniffergithooks Goto Github PK
View Code? Open in Web Editor NEW用于git提交是校验php,js语法及编码规范, 依赖php codesniffer 和gjslint
用于git提交是校验php,js语法及编码规范, 依赖php codesniffer 和gjslint
mac系统会报错 不知道是环境问题还是代码没做兼容
Traceback (most recent call last):
File ".git/hooks/pre-commit", line 11, in
php_errors = get_php_errors()
File "/Users/guojia/bin/git_code_sniffer_hooks/lib/php.py", line 10, in get_commit_errors
return get_php_commit_errors("php", _get_commit_file_error)
File "/Users/guojia/bin/git_code_sniffer_hooks/lib/common.py", line 19, in get_commit_errors
files = _get_commit_files(file_type)
File "/Users/guojia/bin/git_code_sniffer_hooks/lib/common.py", line 83, in _get_commit_files
return _get_files(file_type, 2)
File "/Users/guojia/bin/git_code_sniffer_hooks/lib/common.py", line 93, in _get_files
_ok_code = [0, 1]
File "/Library/Python/2.7/site-packages/sh.py", line 1427, in call
return RunningCommand(cmd, call_args, stdin, stdout, stderr)
File "/Library/Python/2.7/site-packages/sh.py", line 774, in init
self.wait()
File "/Library/Python/2.7/site-packages/sh.py", line 792, in wait
self.handle_command_exit_code(exit_code)
File "/Library/Python/2.7/site-packages/sh.py", line 815, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_2:
RAN: /usr/bin/grep -P (A|M).*.php$
STDOUT:
STDERR:
usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
[-e pattern] [-f file] [--binary-files=value] [--color=when]
[--context[=num]] [--directories=action] [--label] [--line-buffered]
[--null] [pattern] [file ...]
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.