Skip to content

Commit

Permalink
Use Eldev for development
Browse files Browse the repository at this point in the history
  • Loading branch information
doublep authored and bbatsov committed Aug 20, 2020
1 parent 46d2010 commit 79050ac
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 101 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
*\#*\#
*.\#*
*.elc
.cask
elpa*
/Eldev-local
/.eldev
/dist
/TAGS
/project
18 changes: 9 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 0 additions & 7 deletions Cask

This file was deleted.

1 change: 1 addition & 0 deletions Eldev
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(eldev-use-package-archive 'melpa)
31 changes: 0 additions & 31 deletions Makefile

This file was deleted.

22 changes: 15 additions & 7 deletions doc/modules/ROOT/pages/contributing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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`).
4 changes: 3 additions & 1 deletion projectile.el
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down
5 changes: 0 additions & 5 deletions test/elpa.el

This file was deleted.

3 changes: 0 additions & 3 deletions test/make-compile.el

This file was deleted.

26 changes: 0 additions & 26 deletions test/make-update.el

This file was deleted.

18 changes: 9 additions & 9 deletions test/projectile-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 79050ac

Please sign in to comment.