From 72b8847275cb11c606747d962cdbebf4817052f8 Mon Sep 17 00:00:00 2001 From: 10sr <8.slashes@gmail.com> Date: Wed, 19 Feb 2025 20:27:35 +0900 Subject: [PATCH 1/4] Update core-test submodule & Drop Emacs 26 support (#364) * Update core-test submodule * Add fix for spaces_in_middle_key test https://github.com/editorconfig/editorconfig-core-test/pull/51 * Drop Emacs 26 support --- .github/workflows/build.yaml | 6 ------ Eask | 2 +- core-test | 2 +- editorconfig-core-handle.el | 7 +++++-- editorconfig.el | 2 +- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1d58bb76..e6d64f35 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -28,12 +28,6 @@ jobs: - "29.3" experimental: [false] include: - - os: ubuntu-latest - emacs-version: "26.3" - experimental: false - - os: windows-latest - emacs-version: "26.3" - experimental: false - os: ubuntu-latest emacs-version: "27.2" experimental: false diff --git a/Eask b/Eask index 3ac3e5f2..aa384368 100644 --- a/Eask +++ b/Eask @@ -14,7 +14,7 @@ (source "gnu") (source "melpa") -(depends-on "emacs" "26.1") +(depends-on "emacs" "27.2") (depends-on "nadvice") (setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432 diff --git a/core-test b/core-test index 772112ad..7d75ceb5 160000 --- a/core-test +++ b/core-test @@ -1 +1 @@ -Subproject commit 772112adb7aec5fffedf869d0d5a54c8374a0547 +Subproject commit 7d75ceb5bd2e01de40fcb2d1ef91411f8cf4a402 diff --git a/editorconfig-core-handle.el b/editorconfig-core-handle.el index 69eb45f0..a0635cb6 100644 --- a/editorconfig-core-handle.el +++ b/editorconfig-core-handle.el @@ -33,6 +33,9 @@ ;;; Code: (require 'cl-lib) +(when (eval-when-compile (version< emacs-version "28.1")) + ;; For `string-trim' + (require 'subr-x)) (require 'editorconfig-fnmatch) @@ -187,8 +190,8 @@ If CONF is not found return nil." (setq props nil) (setq pattern newpattern))) - ((looking-at "\\([^=: \t]+\\)[ \t]*[=:][ \t]*\\(.*?\\)[ \t]*$") - (let ((key (downcase (match-string 1))) + ((looking-at "\\([^=: \t][^=:]*\\)[ \t]*[=:][ \t]*\\(.*?\\)[ \t]*$") + (let ((key (downcase (string-trim (match-string 1)))) (value (match-string 2))) (if pattern (push `(,key . ,value) diff --git a/editorconfig.el b/editorconfig.el index 29a4f783..74f68614 100644 --- a/editorconfig.el +++ b/editorconfig.el @@ -5,7 +5,7 @@ ;; Author: EditorConfig Team ;; Version: 0.11.0 ;; URL: https://github.com/editorconfig/editorconfig-emacs#readme -;; Package-Requires: ((emacs "26.1")) +;; Package-Requires: ((emacs "27.2")) ;; Keywords: convenience editorconfig ;; See From 610c4276e31ee7b272fd17d5de8b3ad68d8bc06a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Wed, 19 Feb 2025 13:45:08 +0100 Subject: [PATCH 2/4] Show build badge of master branch in README (#367) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a3627a7c..582e6256 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![build](https://github.com/editorconfig/editorconfig-emacs/workflows/build/badge.svg) +![build](https://github.com/editorconfig/editorconfig-emacs/actions/workflows/build.yaml/badge.svg?branch=master) [![MELPA](https://melpa.org/packages/editorconfig-badge.svg)](http://melpa.org/#/editorconfig) [![MELPA Stable](https://stable.melpa.org/packages/editorconfig-badge.svg)](https://stable.melpa.org/#/editorconfig) [![NonGNU ELPA](http://elpa.nongnu.org/nongnu/editorconfig.svg)](http://elpa.nongnu.org/nongnu/editorconfig.html) From 183cfa105c2e14f27525c452532361c108c523cd Mon Sep 17 00:00:00 2001 From: Ron Parker Date: Wed, 19 Feb 2025 09:45:02 -0500 Subject: [PATCH 3/4] Fix parsing section lines with trailing comments (#363) * Fix parsing section lines with trailing comments * (editorconfig-core-handle--parse-file): Fix parsing section lines with trailing comments. Copyright-paperwork-exempt: yes * Add test for section lines with trailing comments --------- Co-authored-by: 10sr <8.slashes@gmail.com> --- CONTRIBUTORS | 1 + editorconfig-core-handle.el | 2 +- ert-tests/editorconfig-core-handle-tests.el | 6 +++++- ert-tests/fixtures/handle2.ini | 4 ++++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 492a943f..0139fd66 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -9,3 +9,4 @@ Hong Xu 10sr Usami Kenta Izaak "Zaak" Beekman +Ron Parker diff --git a/editorconfig-core-handle.el b/editorconfig-core-handle.el index a0635cb6..588419fa 100644 --- a/editorconfig-core-handle.el +++ b/editorconfig-core-handle.el @@ -180,7 +180,7 @@ If CONF is not found return nil." nil) ;; Start of section - ((looking-at "\\[\\(.*\\)\\][ \t]*$") + ((looking-at "\\[\\(.*\\)\\][ \t]*\\(?:[#;].*\\)?$") (let ((newpattern (match-string 1))) (when pattern (push (make-editorconfig-core-handle-section diff --git a/ert-tests/editorconfig-core-handle-tests.el b/ert-tests/editorconfig-core-handle-tests.el index 0ebdab0c..13319834 100644 --- a/ert-tests/editorconfig-core-handle-tests.el +++ b/ert-tests/editorconfig-core-handle-tests.el @@ -67,7 +67,11 @@ (should (equal (editorconfig-core-handle-get-properties handle (concat editorconfig--fixtures "a.js")) - '((("key" . "value")))))) + '((("key" . "value"))))) + (should (equal (editorconfig-core-handle-get-properties handle + (concat editorconfig--fixtures + "b.py")) + '((("key2" . "value2")))))) ;; For checking various normal whitespace (line breaks, horizontal space, vertical space, etc.) (let* ((conf (concat default-directory diff --git a/ert-tests/fixtures/handle2.ini b/ert-tests/fixtures/handle2.ini index 3d0e1346..19e25d18 100644 --- a/ert-tests/fixtures/handle2.ini +++ b/ert-tests/fixtures/handle2.ini @@ -1,3 +1,7 @@ [a.js] key = value + +[b.py] # Section comment + +key2 = value2 From 151eec08303918503001e13bf67af7704c9c860d Mon Sep 17 00:00:00 2001 From: 10sr <8.slashes@gmail.com> Date: Thu, 20 Feb 2025 00:13:21 +0900 Subject: [PATCH 4/4] ci: Test latest Emacs 29.x (#369) Co-authored-by: Jen-Chieh Shen --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e6d64f35..677d9f69 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -25,7 +25,7 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] emacs-version: - "28.2" - - "29.3" + - "29.4" experimental: [false] include: - os: ubuntu-latest @@ -46,7 +46,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive