Add jenkinsfile-mode
Both ‘Jenkinsfile’ files and ‘*.pipeline’ files should be using ‘jenkinsfile-mode’.
This commit is contained in:
parent
5302d5a8ae
commit
6048293876
2 changed files with 46 additions and 2 deletions
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
;; Author: Tom Willemse <tom@ryuslash.org>
|
;; Author: Tom Willemse <tom@ryuslash.org>
|
||||||
;; Keywords: local
|
;; Keywords: local
|
||||||
;; Version: 2019.1210.230729
|
;; Version: 2020.1019.090337
|
||||||
;; Package-Requires: (groovy-mode groovy-imports rainbow-delimiters)
|
;; Package-Requires: (groovy-mode groovy-imports rainbow-delimiters jenkinsfile-mode)
|
||||||
|
|
||||||
;; This program is free software; you can redistribute it and/or modify
|
;; This program is free software; you can redistribute it and/or modify
|
||||||
;; it under the terms of the GNU General Public License as published by
|
;; it under the terms of the GNU General Public License as published by
|
||||||
|
@ -42,6 +42,9 @@
|
||||||
(add-hook 'groovy-mode-hook 'rainbow-delimiters-mode)
|
(add-hook 'groovy-mode-hook 'rainbow-delimiters-mode)
|
||||||
(add-hook 'groovy-mode-hook 'oni-groovy--auto-fill-mode)
|
(add-hook 'groovy-mode-hook 'oni-groovy--auto-fill-mode)
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(add-to-list 'auto-mode-alist `(,(rx ".pipeline" string-end) . jenkinsfile-mode))
|
||||||
|
|
||||||
;;;###autoload(with-eval-after-load 'groovy-mode (require 'oni-groovy))
|
;;;###autoload(with-eval-after-load 'groovy-mode (require 'oni-groovy))
|
||||||
|
|
||||||
(provide 'oni-groovy)
|
(provide 'oni-groovy)
|
||||||
|
|
41
test/integration/oni-groovy.bats
Executable file
41
test/integration/oni-groovy.bats
Executable file
|
@ -0,0 +1,41 @@
|
||||||
|
#!/usr/bin/env bats
|
||||||
|
|
||||||
|
@test "Opening a .groovy file loads oni-groovy" {
|
||||||
|
run emacs -batch -l package -f package-initialize \
|
||||||
|
-visit test.groovy \
|
||||||
|
-eval "(prin1 (featurep 'oni-groovy))"
|
||||||
|
|
||||||
|
echo "$output"
|
||||||
|
|
||||||
|
[[ "$output" == *"t" ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "Opening a Jenkinsfile loads oni-groovy" {
|
||||||
|
run emacs -batch -l package -f package-initialize \
|
||||||
|
-visit Jenkinsfile \
|
||||||
|
-eval "(prin1 (featurep 'oni-groovy))"
|
||||||
|
|
||||||
|
echo "$output"
|
||||||
|
|
||||||
|
[[ "$output" == *"t" ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "Opening a .pipeline file loads oni-groovy" {
|
||||||
|
run emacs -batch -l package -f package-initialize \
|
||||||
|
-visit test.pipeline \
|
||||||
|
-eval "(prin1 (featurep 'oni-groovy))"
|
||||||
|
|
||||||
|
echo "$output"
|
||||||
|
|
||||||
|
[[ "$output" == *"t" ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "Opening a .pipeline file loads jenkinsfile-mode" {
|
||||||
|
run emacs -batch -l package -f package-initialize \
|
||||||
|
-visit "test.pipeline" \
|
||||||
|
-eval "(prin1 major-mode)"
|
||||||
|
|
||||||
|
echo "$output"
|
||||||
|
|
||||||
|
[[ "$output" == *"jenkinsfile-mode" ]]
|
||||||
|
}
|
Loading…
Reference in a new issue