Skip to content

Commit

Permalink
Merge branch 'master' into feat/templ-ts-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
10sr authored Feb 19, 2025
2 parents ca12f1c + 151eec0 commit 823b363
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 16 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,9 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
emacs-version:
- "28.2"
- "29.3"
- "29.4"
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
Expand All @@ -52,7 +46,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ Hong Xu
10sr
Usami Kenta
Izaak "Zaak" Beekman
Ron Parker
2 changes: 1 addition & 1 deletion Eask
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
9 changes: 6 additions & 3 deletions editorconfig-core-handle.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -177,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
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion editorconfig.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
;; Author: EditorConfig Team <[email protected]>
;; 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
Expand Down
6 changes: 5 additions & 1 deletion ert-tests/editorconfig-core-handle-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions ert-tests/fixtures/handle2.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[a.js]

key = value

[b.py] # Section comment

key2 = value2

0 comments on commit 823b363

Please sign in to comment.