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

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

[nongnu] elpa/dockerfile-mode ed1d04c89c 095/104: fix: false positives c


From: ELPA Syncer
Subject: [nongnu] elpa/dockerfile-mode ed1d04c89c 095/104: fix: false positives caused by auto-mode-alist pattern
Date: Sat, 29 Jan 2022 07:58:39 -0500 (EST)

branch: elpa/dockerfile-mode
commit ed1d04c89cd8b53963f2dcae7cb3a46967e0abbf
Author: Jim Myhrberg <contact@jimeh.me>
Commit: Drew Csillag <drew@thecsillags.com>

    fix: false positives caused by auto-mode-alist pattern
    
    The old pattern would match the following filenames:
    
    - *Dockerfile
    - *Dockerfile.*
    
    This is because the pattern does not start with a slash indicating the
    beginning of the basename. Personally this led to a few false positives,
    like for example "siren-dockerfile.el" that sets up and configures
    dockerfile-mode in my Emacs configuration.
    
    This change restricts the patterns to:
    
    - Dockerfile
    - Dockerfile.*
    - *.dockerfile
    
    I believe this is still wide enough to capture all common naming
    conventions for Dockerfiles.
---
 dockerfile-mode.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dockerfile-mode.el b/dockerfile-mode.el
index 2e32e0f4cd..17628d45e7 100644
--- a/dockerfile-mode.el
+++ b/dockerfile-mode.el
@@ -241,7 +241,10 @@ returned, otherwise the base image name is used."
   (set (make-local-variable 'indent-line-function) 
#'dockerfile-indent-line-function))
 
 ;;;###autoload
-(add-to-list 'auto-mode-alist '("Dockerfile\\(?:\\..*\\)?\\'" . 
dockerfile-mode))
+(add-to-list 'auto-mode-alist '("/Dockerfile\\(?:\\..*\\)?\\'" . 
dockerfile-mode))
+
+;;;###autoload
+(add-to-list 'auto-mode-alist '("\\.dockerfile\\'" . dockerfile-mode))
 
 (provide 'dockerfile-mode)
 



reply via email to

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