From 79050ac780f30f12e3a9555df97db85e54cfc8c9 Mon Sep 17 00:00:00 2001 From: Paul Pogonyshev Date: Thu, 20 Aug 2020 00:12:27 +0200 Subject: Use Eldev for development --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .gitignore | 5 +++-- .travis.yml | 18 +++++++++--------- Cask | 7 ------- Eldev | 1 + Makefile | 31 ------------------------------- doc/modules/ROOT/pages/contributing.adoc | 22 +++++++++++++++------- projectile.el | 4 +++- test/elpa.el | 5 ----- test/make-compile.el | 3 --- test/make-update.el | 26 -------------------------- test/projectile-test.el | 18 +++++++++--------- 12 files changed, 41 insertions(+), 101 deletions(-) delete mode 100644 Cask create mode 100644 Eldev delete mode 100644 Makefile delete mode 100644 test/elpa.el delete mode 100644 test/make-compile.el delete mode 100644 test/make-update.el diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index b584fc5..99e8555 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -8,7 +8,7 @@ by checking the relevant checkboxes): - [ ] The commits are consistent with our [contribution guidelines](../blob/master/CONTRIBUTING.md) - [ ] You've added tests (if possible) to cover your change(s) -- [ ] All tests are passing (`make test`) +- [ ] All tests are passing ([`eldev test`](https://github.com/doublep/eldev)) - [ ] The new code is not generating bytecode or `M-x checkdoc` warnings - [ ] You've updated the [changelog](../blob/master/CHANGELOG.md) (if adding/changing user-visible functionality) - [ ] You've updated the readme (if adding/changing user-visible functionality) diff --git a/.gitignore b/.gitignore index 025b7c9..0a6cfad 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,8 @@ *\#*\# *.\#* *.elc -.cask -elpa* +/Eldev-local +/.eldev +/dist /TAGS /project diff --git a/.travis.yml b/.travis.yml index 9a6849c..3323d2b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,18 +2,18 @@ sudo: false language: emacs-lisp dist: xenial env: - - EMACS_BINARY=emacs-25.1-travis MAKE_TEST=test - - EMACS_BINARY=emacs-25.2-travis MAKE_TEST=test - - EMACS_BINARY=emacs-26.3-travis-linux-xenial MAKE_TEST=test - - EMACS_BINARY=emacs-git-snapshot-travis-linux-xenial MAKE_TEST=test + - EMACS_BINARY=emacs-25.1-travis + - EMACS_BINARY=emacs-25.2-travis + - EMACS_BINARY=emacs-26.3-travis-linux-xenial + - EMACS_BINARY=emacs-git-snapshot-travis-linux-xenial matrix: allow_failures: - env: EMACS_BINARY=emacs-git-snapshot-travis fast_finish: true before_script: - - curl -fsSkL https://gist.github.com/rejeep/ebcd57c3af83b049833b/raw > x.sh && source ./x.sh - - evm install $EMACS_BINARY --use --skip - - make elpa + - curl -fsSL https://raw.github.com/doublep/eldev/master/webinstall/travis-eldev-and-evm > x.sh && source ./x.sh + - evm install $EMACS_BINARY --use script: - - emacs --version - - make $MAKE_TEST + - eldev -p -dtT test --expect 100 + # Also require that byte-compilation produces no warnings. + - eldev -dtT compile --warnings-as-errors diff --git a/Cask b/Cask deleted file mode 100644 index 0b6a125..0000000 --- a/Cask +++ /dev/null @@ -1,7 +0,0 @@ -(source gnu) -(source melpa) - -(package-file "projectile.el") - -(development - (depends-on "buttercup")) diff --git a/Eldev b/Eldev new file mode 100644 index 0000000..c51ddaa --- /dev/null +++ b/Eldev @@ -0,0 +1 @@ +(eldev-use-package-archive 'melpa) diff --git a/Makefile b/Makefile deleted file mode 100644 index be36d10..0000000 --- a/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -CASK = cask -export EMACS ?= emacs -EMACSFLAGS = -TESTFLAGS = - -SRCS = $(wildcard *.el) -OBJS = $(SRCS:.el=.elc) - -.PHONY: compile test clean elpa - -all: compile - -elpa-$(EMACS): - $(CASK) install - $(CASK) update - touch $@ - -elpa: elpa-$(EMACS) - -elpaclean: - rm -f elpa* - rm -rf .cask # Clean packages installed for development - -compile: elpa - $(CASK) build - -clean: - rm -f $(OBJS) - -test: elpa - $(CASK) exec buttercup -L . diff --git a/doc/modules/ROOT/pages/contributing.adoc b/doc/modules/ROOT/pages/contributing.adoc index 8b445d1..c7c32e2 100644 --- a/doc/modules/ROOT/pages/contributing.adoc +++ b/doc/modules/ROOT/pages/contributing.adoc @@ -11,8 +11,9 @@ our issue reporting template (it's loaded automatically when you create a new GitHub issue). It's usually a good idea to try to reproduce (obscure) bugs in isolation. You -can do this by cloning Projectile's GitHub repo and running `make run-projectile` inside -it. This will bring up Emacs with only the latest version of Projectile loaded. By +can do this by cloning Projectile's GitHub repo and running `eldev emacs` inside +it (you need to install [Eldev](https://github.com/doublep/eldev) tool first). +This will bring up Emacs with only the latest version of Projectile loaded. By starting fresh, with the latest code, we can ensure that the problem at hand isn't already fixed or caused by interactions with other packages. @@ -90,16 +91,23 @@ https://github.com/sponsors/bbatsov[GitHub Sponsors]. [source,sh] ---- $ cd /path/to/projectile -$ make update -$ make compile -$ make test +$ eldev test ---- -Run all tests with: +If you need to make sure dependencies are at the latest version: [source,sh] ---- -$ make test +$ eldev update +---- + +Run all tests with Projectile installed as an Emacs package +(i.e. byte-compiled and all that; this won't affect your normal Emacs +though): + +[source,sh] +---- +$ eldev -p test ---- Tests should run fine in `shell-mode` or `term-mode`. It's also possible to use kbd:[M-x] `compile` (or `helm-make`). diff --git a/projectile.el b/projectile.el index a0ddd78..873ea77 100644 --- a/projectile.el +++ b/projectile.el @@ -59,12 +59,14 @@ (declare-function make-term "term") (declare-function term-mode "term") (declare-function term-char-mode "term") +(declare-function term-ansi-make-term "term") (declare-function eshell-search-path "esh-ext") (declare-function vc-dir "vc-dir") (declare-function vc-dir-busy "vc-dir") (declare-function string-trim "subr-x") (declare-function fileloop-continue "fileloop") (declare-function fileloop-initialize-replace "fileloop") +(declare-function tramp-archive-file-name-p "tramp-archive") (declare-function ggtags-ensure-project "ext:ggtags") (declare-function ggtags-update-tags "ext:ggtags") @@ -2809,7 +2811,7 @@ test/impl/other files as below: (projectile-register-project-type 'emacs-eldev (lambda () (or (projectile-verify-file "Eldev") (projectile-verify-file "Eldev-local"))) :project-file "Eldev" - :compile "eldev package" + :compile "eldev compile" :test "eldev test" :run "eldev emacs" :package "eldev package") diff --git a/test/elpa.el b/test/elpa.el deleted file mode 100644 index 359ebb9..0000000 --- a/test/elpa.el +++ /dev/null @@ -1,5 +0,0 @@ -(setq package-user-dir - (expand-file-name (format ".elpa/%s/elpa" emacs-version))) -(package-initialize) -(add-to-list 'load-path default-directory) - diff --git a/test/make-compile.el b/test/make-compile.el deleted file mode 100644 index fb097a9..0000000 --- a/test/make-compile.el +++ /dev/null @@ -1,3 +0,0 @@ -(setq files '("projectile.el")) -(setq byte-compile--use-old-handlers nil) -(mapc #'byte-compile-file files) diff --git a/test/make-update.el b/test/make-update.el deleted file mode 100644 index f311da2..0000000 --- a/test/make-update.el +++ /dev/null @@ -1,26 +0,0 @@ -(setq package-user-dir - (expand-file-name (format ".elpa/%s/elpa" emacs-version))) -(message "installing in %s ...\n" package-user-dir) -(package-initialize) -(setq package-archives - '(("melpa" . "http://melpa.org/packages/") - ("gnu" . "http://elpa.gnu.org/packages/"))) -(package-refresh-contents) - -(defconst dev-packages - '(helm noflet ag)) - -(dolist (package dev-packages) - (unless (package-installed-p package) - (ignore-errors - (package-install package)))) - -(save-window-excursion - (package-list-packages t) - (condition-case nil - (progn - (package-menu-mark-upgrades) - (package-menu-execute t)) - (error - (message "All packages up to date")))) - diff --git a/test/projectile-test.el b/test/projectile-test.el index a4f4935..39ce1f8 100644 --- a/test/projectile-test.el +++ b/test/projectile-test.el @@ -32,13 +32,13 @@ (message "Running tests on Emacs %s" emacs-version) ;; TODO: Revise this init logic -(let* ((current-file (if load-in-progress load-file-name (buffer-file-name))) - (source-directory (locate-dominating-file current-file "Cask")) - ;; Do not load outdated byte code for tests - (load-prefer-newer t)) - ;; Load the file under test - (load (expand-file-name "projectile" source-directory)) - (setq projectile-test-path (expand-file-name "test" source-directory))) +(defvar projectile-test-path (let* ((current-file (if load-in-progress load-file-name (buffer-file-name))) + (source-directory (locate-dominating-file current-file "Eldev")) + ;; Do not load outdated byte code for tests + (load-prefer-newer t)) + ;; Load the file under test + (load (expand-file-name "projectile" source-directory)) + (expand-file-name "test" source-directory))) ;;; Test Utilities (defmacro projectile-test-with-sandbox (&rest body) @@ -128,9 +128,9 @@ You'd normally combine this with `projectile-test-with-sandbox'." (describe "projectile-project-type" (it "detects the type of Projectile's project" - (expect (projectile-project-type) :to-equal 'emacs-cask)) + (expect (projectile-project-type) :to-equal 'emacs-eldev)) (it "caches the project type" - (expect (gethash (projectile-project-root) projectile-project-type-cache) :to-equal 'emacs-cask))) + (expect (gethash (projectile-project-root) projectile-project-type-cache) :to-equal 'emacs-eldev))) (describe "projectile-ignored-directory-p" (it "checks if directory should be ignored" -- cgit v1.0