-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Chen Bin
committed
May 26, 2022
1 parent
116b976
commit 38ebbc2
Showing
2 changed files
with
54 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
SHELL = /bin/sh | ||
EMACS ?= emacs | ||
PROFILER = | ||
EMACS_BATCH_OPTS=--batch -Q -l find-file-in-project.el | ||
RM = @rm -rf | ||
|
||
.PHONY: test | ||
.PHONY: test clean test compile | ||
|
||
# Delete byte-compiled files etc. | ||
clean: | ||
rm -f *~ | ||
rm -f \#*\# | ||
rm -f *.elc | ||
$(RM) *~ | ||
$(RM) \#*\# | ||
$(RM) *.elc | ||
|
||
compile: clean | ||
@$(EMACS) $(EMACS_BATCH_OPTS) -l tests/my-byte-compile.el 2>&1 | grep -E "([Ee]rror|[Ww]arning):" && exit 1 || exit 0 | ||
|
||
# Run tests. | ||
test: clean | ||
! $(EMACS) -Q -batch -l find-file-in-project.el --eval "(byte-compile-file \"find-file-in-project.el\")" 2>&1 | grep "Warning: the function" | ||
$(EMACS) -Q -batch -l ert -l find-file-in-project.el -l tests/ffip-tests.el | ||
test: compile | ||
@$(EMACS) $(EMACS_BATCH_OPTS) -l tests/ffip-tests.el |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
;;; my-elint.el --- syntax check the code -*- lexical-binding: t -*- | ||
|
||
;; Copyright (C) 2022 Chen Bin | ||
;; | ||
;; Author: Chen Bin <chenbin.sh@gmail.com> | ||
|
||
;; This file is NOT part of GNU Emacs. | ||
|
||
;; This program is free software; you can redistribute it and/or modify | ||
;; it under the terms of the GNU General Public License as published by | ||
;; the Free Software Foundation; either version 3, or (at your option) | ||
;; any later version. | ||
|
||
;; This program is distributed in the hope that it will be useful, | ||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
;; GNU General Public License for more details. | ||
|
||
;; You should have received a copy of the GNU General Public License | ||
;; along with this program; if not, see <https://www.gnu.org/licenses/>. | ||
|
||
;;; Commentary: | ||
;; Syntax check the code. It's used in Emacs cli. | ||
;; | ||
|
||
;;; Code: | ||
|
||
(require 'find-lisp) | ||
|
||
(let ((files (find-lisp-find-files-internal | ||
"." | ||
(lambda (file dir) | ||
(and (not (file-directory-p (expand-file-name file dir))) | ||
(string-match "\\.el$" file) | ||
(not (string-match "\\.dir-locals\\.el" file)))) | ||
(lambda (dir parent) | ||
(not (or (member dir '("." ".." ".git" ".svn" "deps" "tests")) | ||
(file-symlink-p (expand-file-name dir parent)))))))) | ||
(dolist (file files) | ||
(byte-compile-file file))) | ||
|
||
(provide 'my-byte-compile) | ||
;;; my-elint.el ends here |