emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/parseedn ff81545189 1/2: Draft CI integration


From: ELPA Syncer
Subject: [nongnu] elpa/parseedn ff81545189 1/2: Draft CI integration
Date: Mon, 11 Sep 2023 13:00:47 -0400 (EDT)

branch: elpa/parseedn
commit ff815451894828ab3f02485775df489ca8192d53
Author: vemv <vemv@users.noreply.github.com>
Commit: vemv <vemv@users.noreply.github.com>

    Draft CI integration
---
 .circleci/config.yml            | 144 ++++++++++++++++++++++++++++++++++++++++
 .dir-locals.el                  |  32 +++++++++
 .gitignore                      |   2 +
 Eldev                           |  21 ++++++
 Makefile                        |  23 +++++++
 benchmark/speed-comparison.el   |  36 +++++++++-
 parseedn.el                     |  14 ++--
 test/parseedn-el-parity-test.el |   2 +-
 test/parseedn-test-data.el      |   2 +
 9 files changed, 268 insertions(+), 8 deletions(-)

diff --git a/.circleci/config.yml b/.circleci/config.yml
new file mode 100644
index 0000000000..140e967b53
--- /dev/null
+++ b/.circleci/config.yml
@@ -0,0 +1,144 @@
+version: 2.1
+
+orbs:
+  win: circleci/windows@2.2.0
+
+# Default actions to perform on each Emacs version
+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
+      - run:
+          name: Install unzip
+          command: apt-get update && apt-get install unzip
+
+  macos-setup:
+    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: Run Elisp-lint
+          command: eldev lint
+      - run:
+          name: Byte-compile .el files
+          command: eldev -dtT compile --warnings-as-errors
+
+jobs:
+  test-ubuntu-emacs-26:
+    docker:
+      - image: silex/emacs:26-ci
+        entrypoint: bash
+    steps:
+      - setup
+      - test
+
+  test-ubuntu-emacs-27:
+    docker:
+      - image: silex/emacs:27-ci
+        entrypoint: bash
+    steps:
+      - setup
+      - test
+
+  test-ubuntu-emacs-28:
+    docker:
+      - image: silex/emacs:28-ci
+        entrypoint: bash
+    steps:
+      - setup
+      - test
+  test-ubuntu-emacs-29:
+    docker:
+      - image: silex/emacs:29-ci
+        entrypoint: bash
+    steps:
+      - setup
+      - test
+
+  test-ubuntu-emacs-master:
+    docker:
+      - image: silex/emacs:master-ci
+        entrypoint: bash
+    steps:
+      - setup
+      - test
+
+  test-macos-emacs-latest:
+    macos:
+      xcode: "14.0.0"
+    steps:
+      - macos-setup
+      - test
+
+  test-windows-emacs-latest:
+    executor: win/default
+    steps:
+      - run:
+          name: Install Emacs latest
+          command: |
+            choco install emacs
+      - setup-windows
+      - test
+
+  test-lint:
+    docker:
+      - image: silex/emacs:28-ci
+    steps:
+      - setup
+      - lint
+
+workflows:
+  version: 2.1
+  ci-test-matrix:
+    jobs:
+      - test-lint
+      - test-ubuntu-emacs-26:
+          requires:
+            - test-lint
+      - test-ubuntu-emacs-27:
+          requires:
+            - test-lint
+      - test-ubuntu-emacs-28:
+          requires:
+            - test-lint
+      - test-ubuntu-emacs-29:
+          requires:
+            - test-lint
+      - test-ubuntu-emacs-master:
+          requires:
+            - test-lint
+      - test-windows-emacs-latest:
+          requires:
+            - test-lint
+      - test-macos-emacs-latest:
+          requires:
+            - test-ubuntu-emacs-28
diff --git a/.dir-locals.el b/.dir-locals.el
new file mode 100644
index 0000000000..a722ce1573
--- /dev/null
+++ b/.dir-locals.el
@@ -0,0 +1,32 @@
+;;; Directory Local Variables
+;;; For more information see (info "(emacs) Directory Variables")
+
+((emacs-lisp-mode
+  (bug-reference-url-format . 
"https://github.com/clojure-emacs/parseedn/issues/%s";)
+  (bug-reference-bug-regexp . "#\\(?2:[[:digit:]]+\\)")
+  (indent-tabs-mode . nil)
+  (fill-column . 80)
+  (sentence-end-double-space . t)
+  (emacs-lisp-docstring-fill-column . 75)
+  (checkdoc-symbol-words . ("top-level" "major-mode" "macroexpand-all" 
"print-level" "print-length"))
+  (checkdoc-package-keywords-flag)
+  (checkdoc-arguments-in-order-flag)
+  (checkdoc-verb-check-experimental-flag)
+  (elisp-lint-indent-specs . ((if-let* . 2)
+                              (when-let* . 1)
+                              (let* . defun)
+                              (nrepl-dbind-response . 2)
+                              ;; need better solution for indenting cl-flet 
bindings
+                              (insert-label . defun)              ;; cl-flet
+                              (insert-align-label . defun)        ;; cl-flet
+                              (insert-rect . defun)               ;; cl-flet
+                              (cl-defun . 2)
+                              (with-parsed-tramp-file-name . 2)
+                              (thread-first . 0)
+                              (thread-last . 0)
+                              (transient-define-prefix . defmacro)
+                              (transient-define-suffix . defmacro)))))
+
+;; To use the bug-reference stuff, do:
+;;     (add-hook 'text-mode-hook #'bug-reference-mode)
+;;     (add-hook 'prog-mode-hook #'bug-reference-prog-mode)
diff --git a/.gitignore b/.gitignore
index 433da842b5..7e61b5dd45 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
 .cask
 *.elc
+/.eldev
+/parseedn-autoloads.el
diff --git a/Eldev b/Eldev
new file mode 100644
index 0000000000..5b0853ad71
--- /dev/null
+++ b/Eldev
@@ -0,0 +1,21 @@
+; -*- mode: emacs-lisp; lexical-binding: t; no-byte-compile: t -*-
+
+(eldev-require-version "0.6")
+
+(eldev-use-package-archive 'gnu)
+;; For compatibility; e.g. with MELPA Stable one test fails.
+(eldev-use-package-archive 'melpa-unstable)
+
+(eldev-use-plugin 'autoloads)
+
+(eldev-add-extra-dependencies 'runtime '(:package logview :optional t))
+(eldev-add-extra-dependencies 'runtime '(:package a :optional t))
+
+;; CIDER cannot be compiled otherwise.
+(setf eldev-build-load-before-byte-compiling t)
+
+(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")
+        enable-local-variables        :safe))
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000000..4a4415268c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,23 @@
+.PHONY: clean compile lint test
+.DEFAULT_GOAL := all
+
+# Something like this can be handy if you need Eldev to run on an Emacs other 
than your default one:
+# export ELDEV_EMACS="$HOME/emacs28/Emacs.app/Contents/MacOS/Emacs"
+
+clean:
+       echo
+
+# You can find a generic `eldev` installation script in 
https://github.com/emacs-eldev/eldev/blob/master/webinstall/eldev
+# (Don't use the one defined for CircleCI in your local machine)
+
+lint: clean
+       eldev lint
+
+# Checks for byte-compilation warnings.
+compile: clean
+        eldev -dtT compile --warnings-as-errors
+
+test: clean
+       eldev -dtT -p test
+
+all: lint compile test
diff --git a/benchmark/speed-comparison.el b/benchmark/speed-comparison.el
index 12682112d2..9a0855e165 100644
--- a/benchmark/speed-comparison.el
+++ b/benchmark/speed-comparison.el
@@ -1,8 +1,39 @@
+;;; speed-comparison.el --- benchmark              -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2017-2022  Arne Brasseur
+
+;; Author: Arne Brasseur <arne@arnebrasseur.net>
+;; URL: http://www.github.com/clojure-emacs/parseedn
+
+;; This file is not part of GNU Emacs.
+
+;; This file 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 file 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 GNU Emacs; see the file COPYING.  If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
 ;; takes a file containing edn file names, one per line
 ;;
 ;;    locate *.edn > edn.list
 ;;
 ;; results end up as edn in *edn-parse-time-results*
+
+;;; Code:
+
+(require 'parseedn)
+
 (with-current-buffer (find-file-noselect "edn.list")
   (goto-char 1)
   (while (and (< (point) (point-max)))
@@ -18,9 +49,12 @@
           (setq clj-time (+ clj-time (- (time-to-seconds (current-time)) 
start))))
         (goto-char 1)
         (let ((start (time-to-seconds (current-time))))
-          (edn-read)
+          (parseedn-read)
           (setq edn-time (+ edn-time (- (time-to-seconds (current-time)) 
start)))))
       (kill-buffer buff)
       (when (< (point) (point-max)) (right-char))
       (with-current-buffer "*edn-parse-time-results*"
         (insert "{:file \"" fn "\", :edn-time " (number-to-string edn-time) ", 
:clj-time " (number-to-string clj-time) "}\n")))))
+
+(provide 'speed-comparison)
+;;; speed-comparison.el ends here
diff --git a/parseedn.el b/parseedn.el
index eb36782792..690c582211 100644
--- a/parseedn.el
+++ b/parseedn.el
@@ -3,8 +3,9 @@
 ;; Copyright (C) 2017-2021  Arne Brasseur
 
 ;; Author: Arne Brasseur <arne@arnebrasseur.net>
+;; URL: http://www.github.com/clojure-emacs/parseedn
 ;; Keywords: lisp clojure edn parser
-;; Package-Requires: ((emacs "26") (parseclj "1.1.0") (map "2"))
+;; Package-Requires: ((emacs "26") (parseclj "1.1.0") (map "2") (a "1.0.0"))
 ;; Version: 1.1.0
 
 ;; This file is not part of GNU Emacs.
@@ -32,7 +33,7 @@
 ;; EDN and Emacs Lisp have some important differences that make
 ;; translation from one to the other not transparent (think
 ;; representing an EDN map into Elisp, or being able to differentiate
-;; between false and nil in Elisp). Because of this, parseedn takes
+;; between false and nil in Elisp).  Because of this, parseedn takes
 ;; certain decisions when parsing and transforming EDN data into Elisp
 ;; data types.  For more information please refer to parseclj's design
 ;; documentation.
@@ -164,7 +165,8 @@ TAG-READERS is an optional association list.  For more 
information, see
     (delete-char -1)))
 
 (defun parseedn-print-hash-or-alist (map &optional ks)
-  "Insert hash table MAP or elisp alist as an EDN map into the current buffer."
+  "Insert hash table MAP or elisp alist as an EDN map into the current buffer.
+Selects KS from MAP if specified, otherwise all keys will be selected."
   (when-let ((keys (or ks (map-keys map))))
     (parseedn-print (car keys))
     (insert " ")
@@ -175,7 +177,7 @@ TAG-READERS is an optional association list.  For more 
information, see
         (parseedn-print-hash-or-alist map next)))))
 
 (defun parseedn-print-plist (plist)
-  "Insert an elisp property list as an EDN map into the current buffer."
+  "Insert an elisp property list PLIST as an EDN map into the current buffer."
   (parseedn-print (car plist))
   (insert " ")
   (parseedn-print (cadr plist))
@@ -185,9 +187,9 @@ TAG-READERS is an optional association list.  For more 
information, see
       (parseedn-print-plist next))))
 
 (defun parseedn-print-inst (time)
-  "Insert an inst value into the current buffer.
+  "Insert an inst value TIME into the current buffer.
 
-Take an encode-time style value and print it as a timestamp
+Take an `encode-time' style value and print it as a timestamp
 deliniated by double quotes."
   (insert (format-time-string "\"%Y-%m-%dT%T\"" time)))
 
diff --git a/test/parseedn-el-parity-test.el b/test/parseedn-el-parity-test.el
index 78ef2f68c4..ffbc4a870c 100644
--- a/test/parseedn-el-parity-test.el
+++ b/test/parseedn-el-parity-test.el
@@ -225,7 +225,7 @@
 
 (ert-deftest inst ()
   :tags '(edn inst)
-  (let* ((inst-str "#inst \"1985-04-12T23:20:50.52Z\"")
+  (let* ((inst-str   "#inst \"1985-04-12T23:20:50.52Z\"")
          (inst (parseedn-read-str inst-str))
          (time (date-to-time "1985-04-12T23:20:50.52Z")))
     (should (eq 'edn-inst (car inst)))
diff --git a/test/parseedn-test-data.el b/test/parseedn-test-data.el
index 74b791574c..7fe31ac7c8 100644
--- a/test/parseedn-test-data.el
+++ b/test/parseedn-test-data.el
@@ -27,6 +27,8 @@
 
 ;;; Code:
 
+(require 'a)
+
 (setq parseedn-test-data
       (a-list
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]