diff --git a/ale_linters/gohtmltmpl/djlint.vim b/ale_linters/gohtmltmpl/djlint.vim
new file mode 100644
index 00000000..79f1f8f4
--- /dev/null
+++ b/ale_linters/gohtmltmpl/djlint.vim
@@ -0,0 +1,12 @@
+" Author: Adrian Vollmer
+" Description: djlint for Django HTML template files
+
+call ale#Set('html_djlint_executable', 'djlint')
+call ale#Set('html_djlint_options', '')
+
+call ale#linter#Define('gohtmltmpl', {
+\ 'name': 'djlint',
+\ 'executable': function('ale#handlers#djlint#GetExecutable'),
+\ 'command': function('ale#handlers#djlint#GetCommand'),
+\ 'callback': 'ale#handlers#djlint#Handle',
+\})
diff --git a/ale_linters/handlebars/djlint.vim b/ale_linters/handlebars/djlint.vim
new file mode 100644
index 00000000..b192901f
--- /dev/null
+++ b/ale_linters/handlebars/djlint.vim
@@ -0,0 +1,12 @@
+" Author: Adrian Vollmer
+" Description: djlint for Django HTML template files
+
+call ale#Set('html_djlint_executable', 'djlint')
+call ale#Set('html_djlint_options', '')
+
+call ale#linter#Define('handlebars', {
+\ 'name': 'djlint',
+\ 'executable': function('ale#handlers#djlint#GetExecutable'),
+\ 'command': function('ale#handlers#djlint#GetCommand'),
+\ 'callback': 'ale#handlers#djlint#Handle',
+\})
diff --git a/ale_linters/html/djlint.vim b/ale_linters/html/djlint.vim
index c9cbbd2b..df75fb28 100644
--- a/ale_linters/html/djlint.vim
+++ b/ale_linters/html/djlint.vim
@@ -4,45 +4,11 @@
call ale#Set('html_djlint_executable', 'djlint')
call ale#Set('html_djlint_options', '')
-function! ale_linters#html#djlint#GetExecutable(buffer) abort
- return ale#Var(a:buffer, 'html_djlint_executable')
-endfunction
-
-function! ale_linters#html#djlint#GetCommand(buffer) abort
- let l:executable = ale_linters#html#djlint#GetExecutable(a:buffer)
-
- let l:options = ale#Var(a:buffer, 'html_djlint_options')
-
- return ale#Escape(l:executable)
- \ . (!empty(l:options) ? ' ' . l:options : '') . ' %s'
-endfunction
-
-function! ale_linters#html#djlint#Handle(buffer, lines) abort
- let l:output = []
- let l:pattern = '\v^([A-Z]\d+) (\d+):(\d+) (.*)$'
- let l:i = 0
-
- for l:match in ale#util#GetMatches(a:lines, l:pattern)
- let l:i += 1
- let l:item = {
- \ 'lnum': l:match[2] + 0,
- \ 'col': l:match[3] + 0,
- \ 'vcol': 1,
- \ 'text': l:match[4],
- \ 'code': l:match[1],
- \ 'type': 'W',
- \}
- call add(l:output, l:item)
- endfor
-
- return l:output
-endfunction
-
call ale#linter#Define('html', {
\ 'name': 'djlint',
-\ 'executable': function('ale_linters#html#djlint#GetExecutable'),
-\ 'command': function('ale_linters#html#djlint#GetCommand'),
-\ 'callback': 'ale_linters#html#djlint#Handle',
+\ 'executable': function('ale#handlers#djlint#GetExecutable'),
+\ 'command': function('ale#handlers#djlint#GetCommand'),
+\ 'callback': 'ale#handlers#djlint#Handle',
\})
" vim:ts=4:sw=4:et:
diff --git a/ale_linters/htmlangular/djlint.vim b/ale_linters/htmlangular/djlint.vim
new file mode 100644
index 00000000..b353d741
--- /dev/null
+++ b/ale_linters/htmlangular/djlint.vim
@@ -0,0 +1,12 @@
+" Author: Adrian Vollmer
+" Description: djlint for Django HTML template files
+
+call ale#Set('html_djlint_executable', 'djlint')
+call ale#Set('html_djlint_options', '')
+
+call ale#linter#Define('htmlangular', {
+\ 'name': 'djlint',
+\ 'executable': function('ale#handlers#djlint#GetExecutable'),
+\ 'command': function('ale#handlers#djlint#GetCommand'),
+\ 'callback': 'ale#handlers#djlint#Handle',
+\})
diff --git a/ale_linters/htmldjango/djlint.vim b/ale_linters/htmldjango/djlint.vim
new file mode 100644
index 00000000..9327979f
--- /dev/null
+++ b/ale_linters/htmldjango/djlint.vim
@@ -0,0 +1,12 @@
+" Author: Adrian Vollmer
+" Description: djlint for Django HTML template files
+
+call ale#Set('html_djlint_executable', 'djlint')
+call ale#Set('html_djlint_options', '')
+
+call ale#linter#Define('htmldjango', {
+\ 'name': 'djlint',
+\ 'executable': function('ale#handlers#djlint#GetExecutable'),
+\ 'command': function('ale#handlers#djlint#GetCommand'),
+\ 'callback': 'ale#handlers#djlint#Handle',
+\})
diff --git a/ale_linters/jinja/djlint.vim b/ale_linters/jinja/djlint.vim
new file mode 100644
index 00000000..fd52c954
--- /dev/null
+++ b/ale_linters/jinja/djlint.vim
@@ -0,0 +1,12 @@
+" Author: Adrian Vollmer
+" Description: djlint for Django HTML template files
+
+call ale#Set('html_djlint_executable', 'djlint')
+call ale#Set('html_djlint_options', '')
+
+call ale#linter#Define('jinja', {
+\ 'name': 'djlint',
+\ 'executable': function('ale#handlers#djlint#GetExecutable'),
+\ 'command': function('ale#handlers#djlint#GetCommand'),
+\ 'callback': 'ale#handlers#djlint#Handle',
+\})
diff --git a/ale_linters/nunjucks/djlint.vim b/ale_linters/nunjucks/djlint.vim
new file mode 100644
index 00000000..f71eac6e
--- /dev/null
+++ b/ale_linters/nunjucks/djlint.vim
@@ -0,0 +1,12 @@
+" Author: Adrian Vollmer
+" Description: djlint for Django HTML template files
+
+call ale#Set('html_djlint_executable', 'djlint')
+call ale#Set('html_djlint_options', '')
+
+call ale#linter#Define('nunjucks', {
+\ 'name': 'djlint',
+\ 'executable': function('ale#handlers#djlint#GetExecutable'),
+\ 'command': function('ale#handlers#djlint#GetCommand'),
+\ 'callback': 'ale#handlers#djlint#Handle',
+\})
diff --git a/autoload/ale/fix/registry.vim b/autoload/ale/fix/registry.vim
index 1cc5ee16..a8bcad7c 100644
--- a/autoload/ale/fix/registry.vim
+++ b/autoload/ale/fix/registry.vim
@@ -98,6 +98,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['dhall'],
\ 'description': 'Standard code formatter for the Dhall language and removing dead code',
\ },
+\ 'djlint': {
+\ 'function': 'ale#fixers#djlint#Fix',
+\ 'suggested_filetypes': ['html', 'htmldjango', 'htmlangular', 'jinja', 'handlebars', 'nunjucks', 'gohtmltmpl'],
+\ 'description': 'Fix HTML templates with `djlint --reformat`.',
+\ },
\ 'dune': {
\ 'function': 'ale#fixers#dune#Fix',
\ 'suggested_filetypes': ['dune'],
diff --git a/autoload/ale/fixers/djlint.vim b/autoload/ale/fixers/djlint.vim
new file mode 100644
index 00000000..74c6c261
--- /dev/null
+++ b/autoload/ale/fixers/djlint.vim
@@ -0,0 +1,48 @@
+" Author: Adrian Vollmer (computerfluesterer@protonmail.com)
+" Description: HTML template formatter using `djlint --reformat`
+
+call ale#Set('html_djlint_executable', 'djlint')
+call ale#Set('html_djlint_use_global', get(g:, 'ale_use_global_executables', 0))
+call ale#Set('html_djlint_options', '')
+
+function! ale#fixers#djlint#Fix(buffer) abort
+ let l:executable = ale#python#FindExecutable(
+ \ a:buffer,
+ \ 'html_djlint',
+ \ ['djlint']
+ \)
+
+ let l:options = ale#Var(a:buffer, 'html_djlint_options')
+
+ let l:profile = ''
+ let l:filetypes = split(getbufvar(a:buffer, '&filetype'), '\.')
+
+ " Append the --profile flag depending on the current filetype (unless it's
+ " already set in g:html_djlint_options).
+ if match(l:options, '--profile') == -1
+ let l:djlint_profiles = {
+ \ 'html': 'html',
+ \ 'htmldjango': 'django',
+ \ 'jinja': 'jinja',
+ \ 'nunjucks': 'nunjucks',
+ \ 'handlebars': 'handlebars',
+ \ 'gohtmltmpl': 'golang',
+ \ 'htmlangular': 'angular',
+ \}
+
+ for l:filetype in l:filetypes
+ if has_key(l:djlint_profiles, l:filetype)
+ let l:profile = l:djlint_profiles[l:filetype]
+ break
+ endif
+ endfor
+ endif
+
+ if !empty(l:profile)
+ let l:options = (!empty(l:options) ? l:options . ' ' : '') . '--profile ' . l:profile
+ endif
+
+ return {
+ \ 'command': ale#Escape(l:executable) . ' --reformat ' . l:options . ' -',
+ \}
+endfunction
diff --git a/autoload/ale/handlers/djlint.vim b/autoload/ale/handlers/djlint.vim
new file mode 100644
index 00000000..57015248
--- /dev/null
+++ b/autoload/ale/handlers/djlint.vim
@@ -0,0 +1,64 @@
+" Author: Vivian De Smedt , Adrian Vollmer
+" Description: Adds support for djlint
+"
+function! ale#handlers#djlint#GetExecutable(buffer) abort
+ return ale#Var(a:buffer, 'html_djlint_executable')
+endfunction
+
+function! ale#handlers#djlint#GetCommand(buffer) abort
+ let l:executable = ale#handlers#djlint#GetExecutable(a:buffer)
+
+ let l:options = ale#Var(a:buffer, 'html_djlint_options')
+
+ let l:profile = ''
+ let l:filetypes = split(getbufvar(a:buffer, '&filetype'), '\.')
+
+ " Append the --profile flag depending on the current filetype (unless it's
+ " already set in g:html_djlint_options).
+ if match(l:options, '--profile') == -1
+ let l:djlint_profiles = {
+ \ 'html': 'html',
+ \ 'htmldjango': 'django',
+ \ 'jinja': 'jinja',
+ \ 'nunjucks': 'nunjucks',
+ \ 'handlebars': 'handlebars',
+ \ 'gohtmltmpl': 'golang',
+ \ 'htmlangular': 'angular',
+ \}
+
+ for l:filetype in l:filetypes
+ if has_key(l:djlint_profiles, l:filetype)
+ let l:profile = l:djlint_profiles[l:filetype]
+ break
+ endif
+ endfor
+ endif
+
+ if !empty(l:profile)
+ let l:options = (!empty(l:options) ? l:options . ' ' : '') . '--profile ' . l:profile
+ endif
+
+ return ale#Escape(l:executable)
+ \ . (!empty(l:options) ? ' ' . l:options : '') . ' %s'
+endfunction
+
+function! ale#handlers#djlint#Handle(buffer, lines) abort
+ let l:output = []
+ let l:pattern = '\v^([A-Z]\d+) (\d+):(\d+) (.*)$'
+ let l:i = 0
+
+ for l:match in ale#util#GetMatches(a:lines, l:pattern)
+ let l:i += 1
+ let l:item = {
+ \ 'lnum': l:match[2] + 0,
+ \ 'col': l:match[3] + 0,
+ \ 'vcol': 1,
+ \ 'text': l:match[4],
+ \ 'code': l:match[1],
+ \ 'type': 'W',
+ \}
+ call add(l:output, l:item)
+ endfor
+
+ return l:output
+endfunction
diff --git a/doc/ale-gohtmltmpl.txt b/doc/ale-gohtmltmpl.txt
new file mode 100644
index 00000000..8672f5d4
--- /dev/null
+++ b/doc/ale-gohtmltmpl.txt
@@ -0,0 +1,11 @@
+===============================================================================
+ALE Go HTML Template Integration *ale-gohtmltmpl-options*
+
+
+===============================================================================
+djlint *ale-gohtmltmpl-djlint*
+
+See |ale-html-djlint|
+
+===============================================================================
+ vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/doc/ale-handlebars.txt b/doc/ale-handlebars.txt
index 4a5a3870..8f018d34 100644
--- a/doc/ale-handlebars.txt
+++ b/doc/ale-handlebars.txt
@@ -2,6 +2,13 @@
ALE Handlebars Integration *ale-handlebars-options*
+===============================================================================
+djlint *ale-handlebars-djlint*
+
+See |ale-html-djlint|
+
+===============================================================================
+
===============================================================================
prettier *ale-handlebars-prettier*
diff --git a/doc/ale-html.txt b/doc/ale-html.txt
index de6cf3af..3db3ac85 100644
--- a/doc/ale-html.txt
+++ b/doc/ale-html.txt
@@ -36,6 +36,9 @@ See |ale-cspell-options|
===============================================================================
djlint *ale-html-djlint*
+`djlint` options for HTML are the same as the options for htmlangular,
+htmldjango, jinja, handlebars, nunjucks and gotmplhtml.
+
g:ale_html_djlint_executable *g:ale_html_djlint_executable*
*b:ale_html_djlint_executable*
Type: |String|
diff --git a/doc/ale-htmlangular.txt b/doc/ale-htmlangular.txt
new file mode 100644
index 00000000..0027cfbd
--- /dev/null
+++ b/doc/ale-htmlangular.txt
@@ -0,0 +1,12 @@
+===============================================================================
+ALE HTML Angular Template Integration *ale-htmlangular-options*
+
+
+
+===============================================================================
+djlint *ale-htmlangular-djlint*
+
+See |ale-html-djlint|
+
+===============================================================================
+ vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/doc/ale-htmldjango.txt b/doc/ale-htmldjango.txt
new file mode 100644
index 00000000..14431c8e
--- /dev/null
+++ b/doc/ale-htmldjango.txt
@@ -0,0 +1,12 @@
+===============================================================================
+ALE HTML Django Template Integration *ale-htmldjango-options*
+
+
+
+===============================================================================
+djlint *ale-htmldjango-djlint*
+
+See |ale-html-djlint|
+
+===============================================================================
+ vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/doc/ale-jinja.txt b/doc/ale-jinja.txt
new file mode 100644
index 00000000..37769fe9
--- /dev/null
+++ b/doc/ale-jinja.txt
@@ -0,0 +1,12 @@
+===============================================================================
+ALE Jinja Integration *ale-jinja-options*
+
+
+
+===============================================================================
+djlint *ale-jinja-djlint*
+
+See |ale-html-djlint|
+
+===============================================================================
+ vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/doc/ale-nunjucks.txt b/doc/ale-nunjucks.txt
new file mode 100644
index 00000000..d0e1db26
--- /dev/null
+++ b/doc/ale-nunjucks.txt
@@ -0,0 +1,12 @@
+===============================================================================
+ALE Nunjucks Integration *ale-nunjucks-options*
+
+
+
+===============================================================================
+djlint *ale-nunjucks-djlint*
+
+See |ale-html-djlint|
+
+===============================================================================
+ vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/doc/ale-supported-languages-and-tools.txt b/doc/ale-supported-languages-and-tools.txt
index e178876e..03ef15cc 100644
--- a/doc/ale-supported-languages-and-tools.txt
+++ b/doc/ale-supported-languages-and-tools.txt
@@ -234,6 +234,8 @@ Notes:
* `gotype`!!
* `revive`!!
* `staticcheck`!!
+* Go HTML Templates
+ * djlint
* GraphQL
* `eslint`
* `gqlint`
@@ -247,6 +249,7 @@ Notes:
* Haml
* `haml-lint`
* Handlebars
+ * djlint
* `ember-template-lint`
* Haskell
* `brittany`
@@ -284,6 +287,10 @@ Notes:
* `rustywind`
* `tidy`
* `write-good`
+* HTML Angular
+ * djlint
+* HTML Django
+ * djlint
* Hurl
* `hurlfmt`
* Idris
@@ -321,6 +328,8 @@ Notes:
* `standard`
* `tsserver`
* `xo`
+* Jinja
+ * djlint
* JSON
* `VSCode JSON language server`
* `biome`
@@ -421,6 +430,8 @@ Notes:
* `alex`
* `proselint`
* `write-good`
+* Nunjucks
+ * djlint
* Objective-C
* `ccls`
* `clang`
diff --git a/doc/ale.txt b/doc/ale.txt
index dc9b72a5..601f36dc 100644
--- a/doc/ale.txt
+++ b/doc/ale.txt
@@ -3067,6 +3067,8 @@ documented in additional help files.
govet.................................|ale-go-govet|
revive................................|ale-go-revive|
staticcheck...........................|ale-go-staticcheck|
+ go html template........................|ale-gohtmltmpl-options|
+ djlint................................|ale-gohtmltmpl-djlint|
graphql.................................|ale-graphql-options|
eslint................................|ale-graphql-eslint|
gqlint................................|ale-graphql-gqlint|
@@ -3078,6 +3080,7 @@ documented in additional help files.
hackfmt...............................|ale-hack-hackfmt|
hhast.................................|ale-hack-hhast|
handlebars..............................|ale-handlebars-options|
+ djlint................................|ale-handlebars-djlint|
prettier..............................|ale-handlebars-prettier|
ember-template-lint...................|ale-handlebars-embertemplatelint|
haskell.................................|ale-haskell-options|
@@ -3116,6 +3119,10 @@ documented in additional help files.
tidy..................................|ale-html-tidy|
vscodehtml............................|ale-html-vscode|
write-good............................|ale-html-write-good|
+ html angular template...................|ale-htmlangular-options|
+ djlint................................|ale-htmlangular-djlint|
+ html django template....................|ale-htmldjango-options|
+ djlint................................|ale-htmldjango-djlint|
hurl....................................|ale-hurl-options|
hurlfmt...............................|ale-hurl-hurlfmt|
idris...................................|ale-idris-options|
@@ -3153,6 +3160,8 @@ documented in additional help files.
prettier-standard.....................|ale-javascript-prettier-standard|
standard..............................|ale-javascript-standard|
xo....................................|ale-javascript-xo|
+ jinja...................................|ale-jinja-options|
+ djlint................................|ale-jinja-djlint|
json....................................|ale-json-options|
biome.................................|ale-json-biome|
clang-format..........................|ale-json-clangformat|
@@ -3231,6 +3240,8 @@ documented in additional help files.
deadnix...............................|ale-nix-deadnix|
nroff...................................|ale-nroff-options|
write-good............................|ale-nroff-write-good|
+ nunjucks................................|ale-nunjucks-options|
+ djlint................................|ale-nunjucks-djlint|
objc....................................|ale-objc-options|
ccls..................................|ale-objc-ccls|
clang.................................|ale-objc-clang|
diff --git a/supported-tools.md b/supported-tools.md
index 0cc6dbbd..5bb2e272 100644
--- a/supported-tools.md
+++ b/supported-tools.md
@@ -243,6 +243,8 @@ formatting.
* [gotype](https://godoc.org/golang.org/x/tools/cmd/gotype) :warning: :floppy_disk:
* [revive](https://github.com/mgechev/revive) :warning: :floppy_disk:
* [staticcheck](https://github.com/dominikh/go-tools/tree/master/cmd/staticcheck) :warning: :floppy_disk:
+* Go HTML Templates
+ * [djlint](https://djlint.com/)
* GraphQL
* [eslint](http://eslint.org/)
* [gqlint](https://github.com/happylinks/gqlint)
@@ -256,6 +258,7 @@ formatting.
* Haml
* [haml-lint](https://github.com/brigade/haml-lint)
* Handlebars
+ * [djlint](https://djlint.com/)
* [ember-template-lint](https://github.com/rwjblue/ember-template-lint)
* Haskell
* [brittany](https://github.com/lspitzner/brittany)
@@ -293,6 +296,10 @@ formatting.
* [rustywind](https://github.com/avencera/rustywind)
* [tidy](http://www.html-tidy.org/)
* [write-good](https://github.com/btford/write-good)
+* HTML Angular
+ * [djlint](https://djlint.com/)
+* HTML Django
+ * [djlint](https://djlint.com/)
* Hurl
* [hurlfmt](https://hurl.dev)
* Idris
@@ -330,6 +337,8 @@ formatting.
* [standard](http://standardjs.com/)
* [tsserver](https://github.com/Microsoft/TypeScript/wiki/Standalone-Server-%28tsserver%29)
* [xo](https://github.com/sindresorhus/xo)
+* Jinja
+ * [djlint](https://djlint.com/)
* JSON
* [VSCode JSON language server](https://github.com/hrsh7th/vscode-langservers-extracted)
* [biome](https://biomejs.dev/)
@@ -430,6 +439,8 @@ formatting.
* [alex](https://github.com/get-alex/alex)
* [proselint](http://proselint.com/)
* [write-good](https://github.com/btford/write-good)
+* Nunjucks
+ * [djlint](https://djlint.com/)
* Objective-C
* [ccls](https://github.com/MaskRay/ccls)
* [clang](http://clang.llvm.org/)
diff --git a/test/fixers/test_djlint_fixer_callback.vader b/test/fixers/test_djlint_fixer_callback.vader
new file mode 100644
index 00000000..17224690
--- /dev/null
+++ b/test/fixers/test_djlint_fixer_callback.vader
@@ -0,0 +1,98 @@
+Before:
+ call ale#assert#SetUpFixerTest('html', 'djlint', 'djlint')
+
+After:
+ Restore
+
+ call ale#assert#TearDownFixerTest()
+
+Execute(The djlint callback should return the correct default command):
+ AssertEqual
+ \ {'command': ale#Escape('djlint') . ' --reformat -'},
+ \ ale#fixers#djlint#Fix(bufnr(''))
+
+Execute(The --profile option should not be overridden):
+ call ale#test#SetFilename('../test-files/djlint/testfile.html')
+
+ set filetype=htmldjango
+ let g:ale_html_djlint_options = '--profile jinja'
+
+ AssertFixer
+ \ { 'command': ale#Escape(g:ale_html_djlint_executable)
+ \ . ' --reformat'
+ \ . ' --profile jinja'
+ \ . ' -',
+ \ }
+
+
+Execute(Should set --profile for experimental language, Handlebars):
+ call ale#test#SetFilename('../test-files/djlint/testfile.hbs')
+
+ set filetype=handlebars
+
+ AssertFixer
+ \ { 'command': ale#Escape(g:ale_html_djlint_executable)
+ \ . ' --reformat'
+ \ . ' --profile handlebars'
+ \ . ' -',
+ \ }
+
+Execute(Should set --profile for htmldjango, Django templates):
+ call ale#test#SetFilename('../test-files/djlint/testfile.html')
+
+ set filetype=htmldjango
+
+ AssertFixer
+ \ { 'command': ale#Escape(g:ale_html_djlint_executable)
+ \ . ' --reformat'
+ \ . ' --profile django'
+ \ . ' -',
+ \ }
+
+Execute(Should set --profile for htmlangular):
+ call ale#test#SetFilename('../test-files/djlint/testfile.html')
+
+ set filetype=htmlangular
+
+ AssertFixer
+ \ { 'command': ale#Escape(g:ale_html_djlint_executable)
+ \ . ' --reformat'
+ \ . ' --profile angular'
+ \ . ' -',
+ \ }
+
+Execute(Should set --profile for jinja):
+ call ale#test#SetFilename('../test-files/djlint/testfile.jinja2')
+
+ set filetype=jinja
+
+ AssertFixer
+ \ { 'command': ale#Escape(g:ale_html_djlint_executable)
+ \ . ' --reformat'
+ \ . ' --profile jinja'
+ \ . ' -',
+ \ }
+
+Execute(Should set --profile for nunjucks):
+ call ale#test#SetFilename('../test-files/djlint/testfile.njk')
+
+ set filetype=nunjucks
+
+ AssertFixer
+ \ { 'command': ale#Escape(g:ale_html_djlint_executable)
+ \ . ' --reformat'
+ \ . ' --profile nunjucks'
+ \ . ' -',
+ \ }
+
+Execute(Should set --profile for Go HTML templates):
+ call ale#test#SetFilename('../test-files/djlint/testfile.html')
+
+ set filetype=gohtmltmpl
+
+ AssertFixer
+ \ { 'command': ale#Escape(g:ale_html_djlint_executable)
+ \ . ' --reformat'
+ \ . ' --profile golang'
+ \ . ' -',
+ \ }
diff --git a/test/handler/test_djlint_handler.vader b/test/handler/test_djlint_handler.vader
index 5729f669..3bf916b5 100644
--- a/test/handler/test_djlint_handler.vader
+++ b/test/handler/test_djlint_handler.vader
@@ -16,6 +16,6 @@ Execute(The Djlint handler should parse output with a column correctly):
\ 'type': 'W'
\ }
\ ],
- \ ale_linters#html#djlint#Handle(0, [
+ \ ale#handlers#djlint#Handle(0, [
\ 'H008 47:8 Attributes should be double quoted.'
\ ])
diff --git a/test/linter/test_djlint.vader b/test/linter/test_djlint.vader
index 6d1a0d80..fe87f644 100644
--- a/test/linter/test_djlint.vader
+++ b/test/linter/test_djlint.vader
@@ -12,3 +12,58 @@ Execute(The executable should be configurable):
let g:ale_html_djlint_options = '--option'
AssertLinter 'foo bar', ale#Escape('foo bar') . ' --option %s'
+
+Execute(The --profile option should not be overridden):
+ call ale#test#SetFilename('../test-files/djlint/testfile.html')
+
+ set filetype=htmldjango
+ let g:ale_html_djlint_options = '--profile jinja'
+
+ AssertLinter 'djlint', ale#Escape(g:ale_html_djlint_executable)
+ \ . ' --profile jinja'
+ \ . ' %s',
+
+Execute(Should set --profile for htmlangular):
+ call ale#test#SetFilename('../test-files/djlint/testfile.html')
+
+ set filetype=htmlangular
+
+ AssertLinter 'djlint', ale#Escape(g:ale_html_djlint_executable)
+ \ . ' --profile angular'
+ \ . ' %s',
+
+Execute(Should set --profile for jinja):
+ call ale#test#SetFilename('../test-files/djlint/testfile.html')
+
+ set filetype=jinja
+
+ AssertLinter 'djlint', ale#Escape(g:ale_html_djlint_executable)
+ \ . ' --profile jinja'
+ \ . ' %s',
+
+Execute(Should set --profile for Handlebars):
+ call ale#test#SetFilename('../test-files/djlint/testfile.html')
+
+ set filetype=handlebars
+
+ AssertLinter 'djlint', ale#Escape(g:ale_html_djlint_executable)
+ \ . ' --profile handlebars'
+ \ . ' %s',
+
+Execute(Should set --profile for nunjucks):
+ call ale#test#SetFilename('../test-files/djlint/testfile.html')
+
+ set filetype=nunjucks
+
+ AssertLinter 'djlint', ale#Escape(g:ale_html_djlint_executable)
+ \ . ' --profile nunjucks'
+ \ . ' %s',
+
+Execute(Should set --profile for Go HTML Templates):
+ call ale#test#SetFilename('../test-files/djlint/testfile.html')
+
+ set filetype=gohtmltmpl
+
+ AssertLinter 'djlint', ale#Escape(g:ale_html_djlint_executable)
+ \ . ' --profile golang'
+ \ . ' %s',