[1] project init
This commit is contained in:
commit
ea61d8d6f0
|
@ -0,0 +1,3 @@
|
|||
/src/linter
|
||||
/phptest/
|
||||
*.o
|
|
@ -0,0 +1,47 @@
|
|||
#!/bin/bash
|
||||
|
||||
usage(){
|
||||
echo -e "Usage: php-linter {path}\n";
|
||||
}
|
||||
|
||||
# [1] Manage config
|
||||
#========================================================#
|
||||
# (1) Check argc #
|
||||
if [ $# -lt 1 ]; then
|
||||
|
||||
usage;
|
||||
echo "* Missing argument 'path'";
|
||||
exit 1;
|
||||
|
||||
fi;
|
||||
|
||||
# (2) Check argument @filename #
|
||||
FILENAME="`realpath $1`";
|
||||
|
||||
if [ ! -e $FILENAME ]; then
|
||||
|
||||
usage;
|
||||
echo "* path '$FILENAME' doesn't exist";
|
||||
exit 1;
|
||||
|
||||
fi;
|
||||
|
||||
# (3) Check file or dir #
|
||||
if [ -d $FILENAME ]; then
|
||||
|
||||
count=0;
|
||||
|
||||
## {1} Exec for each file in directory ##
|
||||
for phpfile in `find $FILENAME -name '*.php'`; do
|
||||
|
||||
count=`expr $count + 1`;
|
||||
echo "($count) file $phpfile";
|
||||
./src/linter $phpfile;
|
||||
|
||||
done;
|
||||
|
||||
else
|
||||
## {2} Exec file ##
|
||||
./src/linter $FILENAME;
|
||||
fi;
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
GCCARGV=-Wall
|
||||
|
||||
|
||||
default: compile
|
||||
|
||||
compile: install
|
||||
|
||||
install: linter
|
||||
|
||||
|
||||
|
||||
|
||||
linter: linter.c linter.h
|
||||
gcc $(GCCARGV) -o linter -c linter.c;
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
/**************************
|
||||
* PHP-Linter *
|
||||
***************************
|
||||
* Designed & Developed by *
|
||||
* Adrien Marquès *
|
||||
* <xdrm-brackets> *
|
||||
***************************
|
||||
* doowap31@gmail.com *
|
||||
**************************/
|
||||
#include "linter.h"
|
|
@ -0,0 +1,17 @@
|
|||
/**************************
|
||||
* PHP-Linter *
|
||||
***************************
|
||||
* Designed & Developed by *
|
||||
* Adrien Marquès *
|
||||
* <xdrm-brackets> *
|
||||
***************************
|
||||
* doowap31@gmail.com *
|
||||
**************************/
|
||||
|
||||
#ifndef _LINTER_H_
|
||||
#define _LINTER_H_
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue