mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-17 14:27:12 +09:00
More precise filename detection for shell scripts
Make the regular expression much more precise: * match literal dots instead of any char (match rc.conf but not rcXconf) * match special filenames exactly (match PKGBUILD but not myPKGBUILD.something) Run build-all to update internal/config/runtime.go closes #2163
This commit is contained in:
@@ -1,7 +1,29 @@
|
||||
filetype: shell
|
||||
|
||||
# Detection based on filename is rather complicated as there are many
|
||||
# different file extensions and special filenames in use.
|
||||
# This expressions aims to capture them all while not matching
|
||||
# filenames that coincidentally contain the same substring.
|
||||
#
|
||||
# File extensions:
|
||||
# * .sh
|
||||
# * .bash
|
||||
# * .ash
|
||||
# * .ebuild (Gentoo ebuild format)
|
||||
#
|
||||
# Special filenames:
|
||||
# * .bashrc, .bash_aliases, .bash_functions
|
||||
# * profile, .profile (/etc/profile or ~/.profile)
|
||||
# * Pkgfile
|
||||
# * pkgmk.conf
|
||||
# * rc.conf
|
||||
# * PKGBUILD (Arch Linux build scripts)
|
||||
# * APKBUILD
|
||||
#
|
||||
# Fix command (fc) files:
|
||||
# * bash-fc. (followed by a random string)
|
||||
detect:
|
||||
filename: "(\\.sh$|\\.bash|\\.ash|bashrc|bash_aliases|bash_functions|profile|bash-fc\\.|Pkgfile|pkgmk.conf|rc.conf|PKGBUILD|.ebuild\\$|APKBUILD)"
|
||||
filename: '(\.(sh|bash|ash|ebuild)$|^(\.bash(rc|_aliases|_functions)|\.?profile|Pkgfile|pkgmk\.conf|rc\.conf|PKGBUILD|APKBUILD)$|^bash-fc\.)'
|
||||
header: "^#!.*/(env +)?(ba)?(a)?(mk)?sh( |$)"
|
||||
|
||||
rules:
|
||||
|
||||
Reference in New Issue
Block a user