spacemacs/layers/+tools/ansible/config.el
Brett Campbell f170c732d7 Improve regexp for detecting Ansible files
Additional path names are now detected.

However, the patterns have also been anchored more tightly, meaning they
are more accurate, so they will match less slop (this may affect certain
edge cases where people unknowingly depended on false-positives, e.g.,
`parasite.yml').

Technical details about regexp changes:
  * Remove unnecessary `.*' at beginning
  * Anchor file names with leading `/' to prevent partial matches
      - (eg., don't match `not-main.yml')
  * Restructure capture groups so that `\\.yml' extension is at very end
  * Support `.yaml' extensions as well
  * Anchor the very end with `$'
2019-09-22 19:40:45 +02:00

23 lines
828 B
EmacsLisp

;;; config.el --- Ansible Layer functions File for Spacemacs
;;
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
;;
;; Author: Brian Hicks <brian@brianthicks.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
;; variables
(defvar ansible-auto-encrypt-decrypt t
"Set it to non-nil to seamlessly edit `ansible-vault' encrypted files.
If non-nil then encrypted files are automatically decrypted when opened and
encrypted when saved.")
;; detect filenames compatible with Ansible's recommended layout.
;; http://docs.ansible.com/playbooks_best_practices.html#directory-layout
(setq spacemacs--ansible-filename-re
"/\\(main\\|site\\|encrypted\\|\\(\\(roles\\|tasks\\|handlers\\|vars\\|defaults\\|meta\\|group_vars\\|host_vars\\)/.+\\)\\)\\.ya?ml$")