Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.elc
README
flymake-phpcs-*.tar
flymake-phpcs-pkg.el
36 changes: 36 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.PHONY: all clean install

ARCHIVE_NAME:=flymake-phpcs
VERSION:=$(shell emacs --batch --eval "(with-temp-buffer \
(require 'package)\
(insert-file \"$(ARCHIVE_NAME).el\")\
(princ (aref (package-buffer-info) 3)))")
PACKAGE_NAME:=$(ARCHIVE_NAME)-$(VERSION)

all: $(PACKAGE_NAME).tar

README: README.mkdn
pandoc --atx-headers -t plain -o $@ $^

# requires package-build.el from https://github.com/milkypostman/melpa
# to be available in your emacs load-path
$(ARCHIVE_NAME)-pkg.el: $(ARCHIVE_NAME).el
emacs --batch --user `whoami` --eval "(progn \
(require 'package-build) \
(pb/write-pkg-file \
\"$(ARCHIVE_NAME)-pkg.el\" \
(with-temp-buffer \
(insert-file \"$(ARCHIVE_NAME).el\") \
(package-buffer-info))))"

# create a tar ball in package.el format for uploading to http://marmalade-repo.org
$(PACKAGE_NAME).tar: README $(ARCHIVE_NAME).el $(ARCHIVE_NAME)-pkg.el bin/flymake_phpcs
tar -c -s "@^@$(PACKAGE_NAME)/@" -f $(PACKAGE_NAME).tar $^

install: $(PACKAGE_NAME).tar
emacs --batch --user `whoami` --eval "(progn \
(package-initialize)\
(package-install-file \"`pwd`/${PACKAGE_NAME}.tar\"))"

clean:
$(RM) $(ARCHIVE_NAME)-*.tar $(ARCHIVE_NAME)-pkg.el README
7 changes: 5 additions & 2 deletions flymake-phpcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@

(eval-when-compile (require 'flymake))

(defcustom flymake-phpcs-command "phpcs_flymake"
"If phpcs_flymake isn't in your $PATH, set this to the command needed to run it."
(defcustom flymake-phpcs-command (executable-find (concat
(file-name-directory
(or load-file-name buffer-file-name))
"bin/flymake_phpcs"))
"Location of flymake_phpcs wrapper."
:group 'flymake-phpcs
:type 'string)

Expand Down