-
-
Notifications
You must be signed in to change notification settings - Fork 247
Use Eldev #669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Eldev #669
Changes from all commits
b8af302
d9437a2
3da2c57
9dd4343
d1d124a
83c2a29
6a07260
bbf84bf
d4fa1e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,131 @@ | ||
version: 2.1 | ||
|
||
# Default actions to perform on each Emacs version | ||
default: &default-steps | ||
steps: | ||
- checkout | ||
- run: apt-get update && apt-get install make | ||
- run: make elpa | ||
- run: emacs --version | ||
- run: make test | ||
# Make sure to run test-checks before test-bytecomp, as test-bytecomp autogenerates | ||
# files which won't pass test-checks. | ||
- run: make test-checks | ||
- run: make test-bytecomp | ||
orbs: | ||
win: circleci/[email protected] | ||
|
||
commands: | ||
setup: | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install Eldev | ||
command: curl -fsSL https://raw.github.com/doublep/eldev/master/webinstall/circle-eldev > x.sh && source ./x.sh | ||
|
||
setup-macos: | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install Emacs latest | ||
command: | | ||
brew install homebrew/cask/emacs | ||
- run: | ||
name: Install Eldev | ||
command: curl -fsSL https://raw.github.com/doublep/eldev/master/webinstall/circle-eldev > x.sh && source ./x.sh | ||
|
||
setup-windows: | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install Eldev | ||
command: | | ||
# Remove expired DST Root CA X3 certificate. Workaround | ||
# for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51038 | ||
# bug on Emacs 27.2. | ||
gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13 | ||
gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13 | Remove-Item | ||
(iwr https://raw.github.com/doublep/eldev/master/webinstall/circle-eldev.ps1).Content | powershell -command - | ||
test: | ||
steps: | ||
- run: | ||
name: Run regression tests | ||
command: eldev -dtT -p test | ||
lint: | ||
steps: | ||
- run: | ||
name: Lint | ||
command: eldev lint -c | ||
compile: | ||
steps: | ||
- run: | ||
name: Check for byte-compilation errors | ||
command: eldev -dtT compile --warnings-as-errors | ||
|
||
# Enumerated list of Emacs versions | ||
jobs: | ||
test-emacs-25: | ||
test-ubuntu-emacs-26: | ||
docker: | ||
- image: silex/emacs:25-ci-cask | ||
- image: silex/emacs:26-ci | ||
entrypoint: bash | ||
<<: *default-steps | ||
|
||
test-emacs-26: | ||
steps: | ||
- setup | ||
- test | ||
- lint | ||
- compile | ||
test-ubuntu-emacs-27: | ||
docker: | ||
- image: silex/emacs:26-ci-cask | ||
- image: silex/emacs:27-ci | ||
entrypoint: bash | ||
<<: *default-steps | ||
|
||
test-emacs-27: | ||
steps: | ||
- setup | ||
- test | ||
- lint | ||
- compile | ||
test-ubuntu-emacs-28: | ||
docker: | ||
- image: silex/emacs:27-ci-cask | ||
- image: silex/emacs:28-ci | ||
entrypoint: bash | ||
<<: *default-steps | ||
|
||
test-emacs-28: | ||
steps: | ||
- setup | ||
- test | ||
- lint | ||
- compile | ||
test-ubuntu-emacs-29: | ||
docker: | ||
- image: silex/emacs:28-ci-cask | ||
- image: silex/emacs:29-ci | ||
entrypoint: bash | ||
<<: *default-steps | ||
|
||
test-emacs-master: | ||
steps: | ||
- setup | ||
- test | ||
- lint | ||
- compile | ||
test-ubuntu-emacs-master: | ||
docker: | ||
- image: silex/emacs:master-ci-cask | ||
- image: silex/emacs:master-ci | ||
entrypoint: bash | ||
<<: *default-steps | ||
steps: | ||
- setup | ||
- test | ||
- lint | ||
- compile | ||
test-macos-emacs-latest: | ||
macos: | ||
xcode: "14.2.0" | ||
steps: | ||
- setup-macos | ||
- test | ||
- lint | ||
- compile | ||
test-windows-emacs-latest: | ||
executor: win/default | ||
steps: | ||
- run: | ||
name: Install Emacs latest | ||
command: | | ||
choco install emacs | ||
- setup-windows | ||
- test | ||
- lint | ||
- compile | ||
|
||
workflows: | ||
version: 2 | ||
version: 2.1 | ||
ci-test-matrix: | ||
jobs: | ||
- test-emacs-25 | ||
- test-emacs-26 | ||
- test-emacs-27 | ||
- test-emacs-28 | ||
- test-emacs-master | ||
- test-ubuntu-emacs-26 | ||
- test-ubuntu-emacs-27 | ||
- test-ubuntu-emacs-28 | ||
- test-ubuntu-emacs-29 | ||
- test-ubuntu-emacs-master | ||
- test-windows-emacs-latest | ||
- test-macos-emacs-latest: | ||
requires: | ||
- test-ubuntu-emacs-29 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,6 @@ | |
elpa* | ||
/clojure-mode-autoloads.el | ||
/clojure-mode-pkg.el | ||
|
||
/.eldev | ||
/Eldev-local |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
; -*- mode: emacs-lisp; lexical-binding: t -*- | ||
|
||
(eldev-require-version "1.6") | ||
|
||
(eldev-use-package-archive 'gnu-elpa) | ||
(eldev-use-package-archive 'nongnu-elpa) | ||
(eldev-use-package-archive 'melpa) | ||
|
||
(eldev-use-plugin 'autoloads) | ||
|
||
(eldev-add-extra-dependencies 'test 'paredit 's 'buttercup) | ||
|
||
(setq byte-compile-docstring-max-column 240) | ||
(setq checkdoc-force-docstrings-flag nil) | ||
(setq checkdoc-permit-comma-termination-flag t) | ||
(setq checkdoc--interactive-docstring-flag nil) | ||
|
||
(setf eldev-lint-default '(elisp)) | ||
|
||
(with-eval-after-load 'elisp-lint | ||
;; We will byte-compile with Eldev. | ||
(setf elisp-lint-ignored-validators '("package-lint" "fill-column" "byte-compile" "checkdoc") | ||
enable-local-variables :safe | ||
elisp-lint-indent-specs '((define-clojure-indent . 0)))) | ||
|
||
(setq eldev-project-main-file "clojure-mode.el") |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,17 @@ | ||
CASK = cask | ||
export EMACS ?= emacs | ||
EMACSFLAGS = | ||
|
||
PKGDIR := $(shell EMACS=$(EMACS) $(CASK) package-directory) | ||
|
||
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 | ||
.PHONY: clean compile lint test all | ||
.DEFAULT_GOAL := all | ||
|
||
clean: | ||
rm -f $(OBJS) clojure-mode-autoloads.el | ||
eldev clean | ||
|
||
test: $(PKGDIR) | ||
$(CASK) exec buttercup | ||
lint: clean | ||
eldev lint -c | ||
|
||
test-checks: | ||
$(CASK) exec $(EMACS) --no-site-file --no-site-lisp --batch \ | ||
-l test/test-checks.el ./ | ||
# Checks for byte-compilation warnings. | ||
compile: clean | ||
eldev -dtT compile --warnings-as-errors | ||
|
||
test-bytecomp: $(SRCS:.el=.elc-test) | ||
test: clean | ||
eldev -dtT -p test | ||
|
||
%.elc-test: %.el elpa | ||
$(CASK) exec $(EMACS) --no-site-file --no-site-lisp --batch \ | ||
-l test/clojure-mode-bytecomp-warnings.el $< | ||
all: clean compile lint test |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3129,7 +3129,7 @@ Assumes cursor is at beginning of function." | |
"Add an arity to a function. | ||
|
||
Assumes cursor is at beginning of function." | ||
(let ((beg-line (what-line)) | ||
(let ((beg-line (line-number-at-pos)) | ||
(end (save-excursion (forward-sexp) | ||
(point)))) | ||
(down-list 2) | ||
|
@@ -3141,7 +3141,7 @@ Assumes cursor is at beginning of function." | |
(insert "[") | ||
(save-excursion (insert "])\n("))) | ||
((looking-back "\\[" 1) ;; single-arity fn | ||
(let* ((same-line (string= beg-line (what-line))) | ||
(let* ((same-line (= beg-line (line-number-at-pos))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please confirm that you've run this modified version locally |
||
(new-arity-text (concat (when same-line "\n") "(["))) | ||
(save-excursion | ||
(goto-char end) | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,7 @@ | |
(bb-edn-src (expand-file-name "src" temp-dir))) | ||
(write-region "{}" nil bb-edn) | ||
(make-directory bb-edn-src) | ||
(expect (clojure-project-dir bb-edn-src) | ||
(expect (expand-file-name (clojure-project-dir bb-edn-src)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure why this is needed. This test was failing only on windows. |
||
:to-equal (file-name-as-directory temp-dir)))))) | ||
|
||
(describe "clojure-project-relative-path" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this change 3 tests for
clojure-add-arity
were failing with an additional \n in the generated output. Only happens when running tests with eldev.(Might be becausewhat-line
is an interactive fn with side effects)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounding good. Please confirm that you've run this modified version locally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have run it locally and it works fine.
Locally both the versions work but not using
what-line
is still better.