source: trunk/Makefile @ 1184

Revision 1177, 925 bytes checked in by bogdan2412, 2 months ago (diff)

Linting engine using Facebook's Arcanist.

Arcanist is mainly a command line tool for code review and revision
management. We will only use it for linting our source code _for now_.
The linter is pure awesome and it will check everything from naming
conventions, line width, uninitialized variables to file names and
spelling.

Typing 'make lint' will download a copy of arcanist and libphutil from
github on the first run. It will then run the linter on any files that
you have touched during your commit, while mostly only looking on the
lines you've changed. 'make lint-all' will be a bit more thorough and
look at the entire files.
'make lint-repo' will run the linter on the entire codebase, which will
make you quietly weep.

From this point, either 'make lint' or 'make lint-all' (preferred) will
have to be run before any change is posted for review.

REVIEW URL: http://reviewboard.infoarena.ro/r/200/

Line 
1.PHONY: hphp-build clean-cache clean-hphp clean lint
2
3hphp-build:
4        mkdir -p hphp/build/
5        find common/ www/ eval/ hphp/ config.php -name "*.php" > hphp/build/filelist
6        hphp --input-list=hphp/build/filelist -o hphp/build/ --program infoarena -l 3 --cluster-count 8
7
8clean-cache:
9        find cache/ -type f -exec rm {} +
10        rm -rf www/static/images/{latex,tmp}/*
11
12clean-hphp:
13        rm -rf hphp/build/*
14
15clean-sessions:
16        find /var/infoarena/sessions/ -name sess_\* -exec rm {} +
17
18clean: clean-cache clean-hphp clean-sessions
19
20arcanist:
21        git clone git://github.com/facebook/arcanist.git
22
23libphutil:
24        git clone git://github.com/facebook/libphutil.git
25        libphutil/scripts/build_xhpast.sh
26
27lint: arcanist libphutil
28        arcanist/bin/arc lint --apply-patches
29
30lint-all: arcanist libphutil
31        arcanist/bin/arc lint --apply-patches --lintall
32
33lint-repo: arcanist libphutil
34        find . -name \*.php | xargs arcanist/bin/arc lint --lintall --never-apply-patches
Note: See TracBrowser for help on using the repository browser.