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

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

[nongnu] elpa/zig-mode 5d58b22dcb 23/24: Merge branch 'master' into mast


From: ELPA Syncer
Subject: [nongnu] elpa/zig-mode 5d58b22dcb 23/24: Merge branch 'master' into master
Date: Wed, 21 Feb 2024 07:01:42 -0500 (EST)

branch: elpa/zig-mode
commit 5d58b22dcb3fd3b9d3a1c96a1c9eb6a4de4384b5
Merge: 2f9b70a6c6 324ee9d07d
Author: Jen-Chieh Shen <jcs090218@gmail.com>
Commit: GitHub <noreply@github.com>

    Merge branch 'master' into master
---
 .github/dependabot.yml        |  6 +++++
 .github/workflows/main.yml    | 56 ++++++++++++++++++++++++++++++-------------
 .gitignore                    |  4 ++++
 Eask                          | 18 ++++++++++++++
 README.md                     | 42 +++++++++++++++++++++++++-------
 appveyor.yml                  |  7 ------
 tests.el => test/zig-tests.el |  0
 zig-mode.el                   | 56 ++++++++++++++++++++-----------------------
 8 files changed, 128 insertions(+), 61 deletions(-)

diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000000..253bcb76ba
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,6 @@
+version: 2
+updates:
+  - package-ecosystem: github-actions
+    directory: /
+    schedule:
+      interval: daily
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 2b7254a9bf..beaa688061 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -1,29 +1,53 @@
 name: CI
 
-on: [push, pull_request]
+on:
+  push:
+    branches:
+      - master
+  pull_request:
+  workflow_dispatch:
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true
 
 jobs:
   build:
-    runs-on: ubuntu-latest
+    runs-on: ${{ matrix.os }}
+    continue-on-error: ${{ matrix.experimental }}
     strategy:
+      fail-fast: false
       matrix:
-        emacs_version:
-          - 24.4
-          - 24.5
-          - 25.1
-          - 25.2
-          - 25.3
-          - 26.1
-          - 26.2
+        os: [ubuntu-latest, macos-latest, windows-latest]
+        emacs-version:
           - 26.3
-          - 27.1
           - 27.2
-          - 28.1
           - 28.2
+          - 29.2
+        experimental: [false]
+        include:
+          - os: ubuntu-latest
+            emacs-version: snapshot
+            experimental: true
+          - os: macos-latest
+            emacs-version: snapshot
+            experimental: true
+
     steps:
-    - uses: purcell/setup-emacs@master
+    - uses: jcs090218/setup-emacs@master
+      with:
+        version: ${{ matrix.emacs-version }}
+
+    - uses: emacs-eask/setup-eask@master
       with:
-        version: ${{ matrix.emacs_version }}
-    - uses: actions/checkout@v2
+        version: 'snapshot'
+
+    - uses: actions/checkout@v4
+
     - name: Run tests
-      run: ./run_tests.sh
+      run: |
+        eask install-deps
+        eask package
+        eask install
+        eask compile
+        eask test ert ./test/*.el
diff --git a/.gitignore b/.gitignore
index c531d9867f..fb33dd589d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,5 @@
 *.elc
+
+# build tools
+.eask/
+dist/
diff --git a/Eask b/Eask
new file mode 100644
index 0000000000..469feb5add
--- /dev/null
+++ b/Eask
@@ -0,0 +1,18 @@
+(package "zig-mode"
+         "0.0.8"
+         "A major mode for the Zig programming language")
+
+(website-url "https://github.com/zig-lang/zig-mode";)
+(keywords "zig" "languages")
+
+(package-file "zig-mode.el")
+
+(script "test" "echo \"Error: no test specified\" && exit 1")
+
+(source 'gnu)
+(source 'melpa)
+
+(depends-on "emacs" "26.1")
+(depends-on "reformatter")
+
+(setq network-security-level 'low)  ; see 
https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432
diff --git a/README.md b/README.md
index 3dd944a172..e1e77d6dc0 100644
--- a/README.md
+++ b/README.md
@@ -36,20 +36,46 @@ Then add the following to your `.emacs` file:
 
 
[![CI](https://github.com/ziglang/zig-mode/actions/workflows/main.yml/badge.svg)](https://github.com/ziglang/zig-mode/actions/workflows/main.yml)
 
-To run all unit tests with `emacs`, run:
+To run the test locally, you will need the following tools:
 
-```bash
-./run_tests.sh
+- [Eask](https://emacs-eask.github.io/)
+- [Make](https://www.gnu.org/software/make/) (optional)
+
+Install all dependencies and development dependencies:
+
+```sh
+$ eask install-deps --dev
 ```
 
-Note that Emacs 24.3 or later is required.  If you need to specify which Emacs
-binary to use, you can do that by setting the `EMACS` environment variable,
-e.g.:
+To test the package's installation:
 
-```bash
-EMACS=/usr/bin/emacs24 ./run_tests.sh
+```sh
+$ eask package
+$ eask install
 ```
 
+To test compilation:
+
+```sh
+$ eask compile
+```
+
+**🪧 The following steps are optional, but we recommend you follow these lint 
results!**
+
+The built-in `checkdoc` linter:
+
+```sh
+$ eask lint checkdoc
+```
+
+The standard `package` linter:
+
+```sh
+$ eask lint package
+```
+
+*📝 P.S. For more information, find the Eask manual at 
https://emacs-eask.github.io/.*
+
 ## Optional Configuration
 
 `zig-mode` used to enable coloration of the compilation buffer using
diff --git a/appveyor.yml b/appveyor.yml
deleted file mode 100644
index a0285bef2a..0000000000
--- a/appveyor.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-image: ubuntu
-install:
-- sudo apt-get update
-- sudo apt-get install -y emacs25
-build: off
-test_script:
-- ./run_tests.sh
diff --git a/tests.el b/test/zig-tests.el
similarity index 100%
rename from tests.el
rename to test/zig-tests.el
diff --git a/zig-mode.el b/zig-mode.el
index 04c2fdbe35..533f589af2 100644
--- a/zig-mode.el
+++ b/zig-mode.el
@@ -1,10 +1,12 @@
 ;;; zig-mode.el --- A major mode for the Zig programming language -*- 
lexical-binding: t -*-
 
+;; Author: Andrea Orru <andreaorru1991@gmail.com>
+;;         Andrew Kelley <superjoe30@gmail.com>
+;; Maintainer: Shen, Jen-Chieh <jcs090218@gmail.com>
+;; URL: https://github.com/zig-lang/zig-mode
 ;; Version: 0.0.8
-;; Author: Andrea Orru <andreaorru1991@gmail.com>, Andrew Kelley 
<superjoe30@gmail.com>
+;; Package-Requires: ((emacs "26.1") (reformatter "0.6"))
 ;; Keywords: zig, languages
-;; Package-Requires: ((emacs "24.3") (reformatter "0.6"))
-;; Homepage: https://github.com/zig-lang/zig-mode
 
 ;; 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
@@ -91,31 +93,31 @@ If given a SOURCE, execute the CMD on it."
 (defun zig-build-exe ()
   "Create executable from source or object file."
   (interactive)
-  (zig--run-cmd "build-exe" (buffer-file-name)))
+  (zig--run-cmd "build-exe" (file-local-name (buffer-file-name))))
 
 ;;;###autoload
 (defun zig-build-lib ()
   "Create library from source or assembly."
   (interactive)
-  (zig--run-cmd "build-lib" (buffer-file-name)))
+  (zig--run-cmd "build-lib" (file-local-name (buffer-file-name))))
 
 ;;;###autoload
 (defun zig-build-obj ()
   "Create object from source or assembly."
   (interactive)
-  (zig--run-cmd "build-obj" (buffer-file-name)))
+  (zig--run-cmd "build-obj" (file-local-name (buffer-file-name))))
 
 ;;;###autoload
 (defun zig-test-buffer ()
   "Test buffer using `zig test`."
   (interactive)
-  (zig--run-cmd "test" (buffer-file-name) "-O" zig-test-optimization-mode))
+  (zig--run-cmd "test" (file-local-name (buffer-file-name)) "-O" 
zig-test-optimization-mode))
 
 ;;;###autoload
 (defun zig-run ()
   "Create an executable from the current buffer and run it immediately."
   (interactive)
-  (zig--run-cmd "run" (buffer-file-name) "-O" zig-run-optimization-mode))
+  (zig--run-cmd "run" (file-local-name (buffer-file-name)) "-O" 
zig-run-optimization-mode))
 
 ;; zig fmt
 
@@ -174,11 +176,10 @@ If given a SOURCE, execute the CMD on it."
     table))
 
 (defconst zig-keywords
-  '(
-    ;; Storage
+  '(;; Storage
     "const" "var" "extern" "packed" "export" "pub" "noalias" "inline"
     "noinline" "comptime" "callconv" "volatile" "allowzero"
-    "align" "linksection" "threadlocal"
+    "align" "linksection" "threadlocal" "addrspace"
 
     ;; Structure
     "struct" "enum" "union" "error" "opaque"
@@ -197,17 +198,16 @@ If given a SOURCE, execute the CMD on it."
     "fn" "usingnamespace" "test"))
 
 (defconst zig-types
-  '(
-    ;; Integer types
+  '(;; Integer types
     "i2" "u2" "i3" "u3" "i4" "u4" "i5" "u5" "i6" "u6" "i7" "u7" "i8" "u8"
     "i16" "u16" "i29" "u29" "i32" "u32" "i64" "u64" "i128" "u128"
     "isize" "usize"
 
     ;; Floating types
-    "f16" "f32" "f64" "f128"
+    "f16" "f32" "f64" "f80" "f128"
 
     ;; C types
-    "c_short" "c_ushort" "c_int" "c_uint" "c_long" "c_ulong"
+    "c_char" "c_short" "c_ushort" "c_int" "c_uint" "c_long" "c_ulong"
     "c_longlong" "c_ulonglong" "c_longdouble"
 
     ;; Comptime types
@@ -218,15 +218,14 @@ If given a SOURCE, execute the CMD on it."
     "anyopaque"))
 
 (defconst zig-constants
-  '(
-    ;; Boolean
+  '(;; Boolean
     "true" "false"
 
     ;; Other constants
     "null" "undefined"))
 
 (defconst zig-electric-indent-chars
-  '( ?\; ?\, ?\) ?\] ?\} ))
+  '(?\; ?\, ?\) ?\] ?\}))
 
 (defface zig-multiline-string-face
   '((t :inherit font-lock-string-face))
@@ -235,8 +234,7 @@ If given a SOURCE, execute the CMD on it."
 
 (defvar zig-font-lock-keywords
   (append
-   `(
-     ;; Builtins (prefixed with @)
+   `(;; Builtins (prefixed with @)
      (,(concat "@" zig-re-identifier) . font-lock-builtin-face)
 
      ;; Keywords, constants and types
@@ -246,8 +244,7 @@ If given a SOURCE, execute the CMD on it."
 
      ;; Type annotations (both variable and type)
      (,zig-re-type-annotation 1 font-lock-variable-name-face)
-     (,zig-re-type-annotation 2 font-lock-type-face)
-     )
+     (,zig-re-type-annotation 2 font-lock-type-face))
 
    ;; Definitions
    (mapcar (lambda (x)
@@ -470,24 +467,23 @@ This is written mainly to be used as 
`end-of-defun-function' for Zig."
                   '("enum" "struct" "union"))
           `(("Fn" ,(zig-re-definition "fn") 1))))
 
-;;; Guarantee filesystem unix line endings
 (defun zig-file-coding-system ()
+  "Guarantee filesystem unix line endings."
   (with-current-buffer (current-buffer)
     (if (buffer-file-name)
         (if (string-match "\\.d?zig\\'" buffer-file-name)
             (setq buffer-file-coding-system 'utf-8-unix)
-          nil))
-))
+          nil))))
 
 (add-hook 'zig-mode-hook 'zig-file-coding-system)
 
 (defvar zig-mode-map
   (let ((map (make-sparse-keymap)))
-       (define-key map (kbd "C-c C-b") 'zig-compile)
-       (define-key map (kbd "C-c C-f") 'zig-format-buffer)
-       (define-key map (kbd "C-c C-r") 'zig-run)
-       (define-key map (kbd "C-c C-t") 'zig-test-buffer)
-       map)
+    (define-key map (kbd "C-c C-b") #'zig-compile)
+    (define-key map (kbd "C-c C-f") #'zig-format-buffer)
+    (define-key map (kbd "C-c C-r") #'zig-run)
+    (define-key map (kbd "C-c C-t") #'zig-test-buffer)
+    map)
   "Keymap for Zig major mode.")
 
 ;;;###autoload



reply via email to

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