FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
CodeIgniter4/admin/pre-commit at develop · mathsolutions/CodeIgniter4 · GitHub
mathsolutions
/
CodeIgniter4
Public
forked from
codeigniter4/CodeIgniter4
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
CodeIgniter4
/
admin
/
pre-commit
Copy path
More file actions
More file actions
Latest commit
History
History
History
40 lines (30 loc) · 1.03 KB
Breadcrumbs
CodeIgniter4
/
admin
/
pre-commit
Copy path
File metadata and controls
40 lines (30 loc) · 1.03 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!
/bin/sh
PROJECT=
`
php -r
"
echo dirname(dirname(dirname(realpath('
$0
'))));
"
`
STAGED_PHP_FILES=
`
git diff --cached --name-only --diff-filter=ACMR HEAD
|
grep
\\\\
.php$
`
STAGED_RST_FILES=
`
git diff --cached --name-only --diff-filter=ACMR HEAD
|
grep
\\\\
.rst$
`
echo
"
Starting CodeIgniter precommit...
"
if
[
"
$STAGED_PHP_FILES
"
!=
"
"
]
;
then
echo
"
Linting PHP code...
"
for
FILE
in
$STAGED_PHP_FILES
;
do
php -l -d display_errors=0
"
$PROJECT
/
$FILE
"
if
[
$?
!=
0 ]
;
then
echo
"
Fix the error(s) before commit.
"
exit
1
fi
FILES=
"
$FILES
$FILE
"
done
fi
if
[
"
$FILES
"
!=
"
"
]
;
then
echo
"
Running PHP CS Fixer...
"
#
Run on whole codebase to skip on unnecessary filtering
composer cs
if
[
$?
!=
0 ]
;
then
echo
"
There are PHP files which are not following the coding standards. Please fix them before commit.
"
exit
1
fi
fi
if
[
"
$STAGED_RST_FILES
"
!=
"
"
]
;
then
echo
"
Checking for tabs in RST files
"
php ./utils/check_tabs_in_rst.php
fi
exit
$?
Back
|
FazBrowse Home
|
New Git URL