vim-patch:9.1.0326: filetype: some requirements files are not recognized (#28360)

Problem:  filetype: some requirements files are not recognized
Solution: Detect '*-requirements.txt', 'constraints.txt',
          'requirements.in', 'requirements/*.txt' and 'requires/*.txt'
          as requirements filetype, include pip compiler, include
          requirements filetype and syntax plugin
          (Wu, Zhenyu, @raimon49)

closes: vim/vim#14379

f9f5424d3e

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Co-authored-by: raimon <raimon49@hotmail.com>
This commit is contained in:
zeertzjq
2024-04-16 09:33:33 +08:00
committed by GitHub
parent 07661009c5
commit fb7ffac69f
6 changed files with 161 additions and 3 deletions

View File

@@ -62,10 +62,10 @@ func Test_compiler_completion()
call assert_match('^"compiler ' .. clist .. '$', @:)
call feedkeys(":compiler p\<C-A>\<C-B>\"\<CR>", 'tx')
call assert_match('"compiler pandoc pbx perl\( p[a-z]\+\)\+ pylint pyunit', @:)
call assert_match('"compiler pandoc pbx perl\( p[a-z_]\+\)\+ pylint pyunit', @:)
call feedkeys(":compiler! p\<C-A>\<C-B>\"\<CR>", 'tx')
call assert_match('"compiler! pandoc pbx perl\( p[a-z]\+\)\+ pylint pyunit', @:)
call assert_match('"compiler! pandoc pbx perl\( p[a-z_]\+\)\+ pylint pyunit', @:)
endfunc
func Test_compiler_error()

View File

@@ -595,7 +595,7 @@ func s:GetFilenameChecks() abort
\ 'readline': ['.inputrc', 'inputrc'],
\ 'rego': ['file.rego'],
\ 'remind': ['.reminders', 'file.remind', 'file.rem', '.reminders-file'],
\ 'requirements': ['file.pip', 'requirements.txt'],
\ 'requirements': ['file.pip', 'requirements.txt', 'dev-requirements.txt', 'constraints.txt', 'requirements.in', 'requirements/dev.txt', 'requires/dev.txt'],
\ 'rescript': ['file.res', 'file.resi'],
\ 'resolv': ['resolv.conf'],
\ 'reva': ['file.frt'],