From 5a5a28c135d651cfce5fd63d4e125f0ea418d3f7 Mon Sep 17 00:00:00 2001 From: raimon Date: Thu, 22 Mar 2018 01:35:33 +0900 Subject: [PATCH 1/6] Update pattern of package name c.f.) https://www.python.org/dev/peps/pep-0508/ > ^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])$ --- syntax/requirements.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax/requirements.vim b/syntax/requirements.vim index 351ff5b..7e82fcb 100644 --- a/syntax/requirements.vim +++ b/syntax/requirements.vim @@ -12,7 +12,7 @@ syn case match syn region requirementsComment start="[ \t]*#" end="$" syn match requirementsCommandOption "\v^\[?--?[a-zA-Z\-]*\]?" syn match requirementsVersionSpecifiers "\v(\=\=\=?|\<\=?|\>\=?|\~\=|\!\=)" -syn match requirementsPackageName "\v^[a-zA-Z][a-zA-Z\-_\.0-9]*" +syn match requirementsPackageName "\v^([a-zA-Z0-9][a-zA-Z0-9\-_\.]*[a-zA-Z0-9])" syn match requirementsVersionControls "\v(git\+?|hg\+|svn\+|bzr\+)\S+" hi link requirementsComment Comment From 634748cba9ceaa53b73382c1440f1b9af0b48ff2 Mon Sep 17 00:00:00 2001 From: raimon Date: Thu, 22 Mar 2018 01:37:28 +0900 Subject: [PATCH 2/6] Define pattern of URLs URLs and VCSs highlighting is 'Underlined' --- syntax/requirements.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/syntax/requirements.vim b/syntax/requirements.vim index 7e82fcb..3c3d5c3 100644 --- a/syntax/requirements.vim +++ b/syntax/requirements.vim @@ -14,12 +14,14 @@ syn match requirementsCommandOption "\v^\[?--?[a-zA-Z\-]*\]?" syn match requirementsVersionSpecifiers "\v(\=\=\=?|\<\=?|\>\=?|\~\=|\!\=)" syn match requirementsPackageName "\v^([a-zA-Z0-9][a-zA-Z0-9\-_\.]*[a-zA-Z0-9])" syn match requirementsVersionControls "\v(git\+?|hg\+|svn\+|bzr\+)\S+" +syn match requirementsURLs "\v\@\s\S+" hi link requirementsComment Comment hi link requirementsCommandOption Special hi link requirementsVersionSpecifiers Boolean hi link requirementsPackageName Identifier -hi link requirementsVersionControls Identifier +hi link requirementsVersionControls Underlined +hi link requirementsURLs Underlined let b:current_syntax = "requirements" From 71fd018154536939528cc724ca563106df6a006c Mon Sep 17 00:00:00 2001 From: raimon Date: Thu, 22 Mar 2018 02:06:01 +0900 Subject: [PATCH 3/6] Define pattern of Extras and Environment Markers --- syntax/requirements.vim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/syntax/requirements.vim b/syntax/requirements.vim index 3c3d5c3..cf2c408 100644 --- a/syntax/requirements.vim +++ b/syntax/requirements.vim @@ -13,15 +13,19 @@ syn region requirementsComment start="[ \t]*#" end="$" syn match requirementsCommandOption "\v^\[?--?[a-zA-Z\-]*\]?" syn match requirementsVersionSpecifiers "\v(\=\=\=?|\<\=?|\>\=?|\~\=|\!\=)" syn match requirementsPackageName "\v^([a-zA-Z0-9][a-zA-Z0-9\-_\.]*[a-zA-Z0-9])" +syn match requirementsExtras "\v\[\S+\]" syn match requirementsVersionControls "\v(git\+?|hg\+|svn\+|bzr\+)\S+" syn match requirementsURLs "\v\@\s\S+" +syn match requirementsEnvironmentMarkers "\v;\s.+$" hi link requirementsComment Comment hi link requirementsCommandOption Special hi link requirementsVersionSpecifiers Boolean hi link requirementsPackageName Identifier +hi link requirementsExtras Type hi link requirementsVersionControls Underlined hi link requirementsURLs Underlined +hi link requirementsEnvironmentMarkers Macro let b:current_syntax = "requirements" From b35701afd9c213a04ad44099e113e7d8262f19b4 Mon Sep 17 00:00:00 2001 From: raimon Date: Thu, 22 Mar 2018 02:07:18 +0900 Subject: [PATCH 4/6] Add examples from PEP508 --- examples/requirements.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/requirements.txt b/examples/requirements.txt index f06cef4..991b7dd 100644 --- a/examples/requirements.txt +++ b/examples/requirements.txt @@ -17,6 +17,13 @@ Sphinx==1.3.3 sphinx-rtd-theme==0.1.9 zope.interface==4.2.0 +# Examples from PEP508 +# c.f. https://www.python.org/dev/peps/pep-0508/ +requests [security,tests] >= 2.8.1, == 2.8.* ; python_version < "2.7" +pip @ https://github.com/pypa/pip/archive/1.3.1.zip#sha1=da9234ee9982d4bbb3c72346a6de940a148ea686 +name @ gopher:/foo/com" +foobar[quux]<2,>=3; os_name=='a' + # VCS repositories [-e] git+git://git.myproject.org/MyProject#egg=MyProject # Git [-e] git://git.myproject.org/MyProject.git@v1.0#egg=MyProject From b46aaca88f9d18ec032f770e7d2e6f3bbed34b84 Mon Sep 17 00:00:00 2001 From: raimon Date: Thu, 22 Mar 2018 02:20:45 +0900 Subject: [PATCH 5/6] Bump version to 1.5.0 --- autoload/requirements.vim | 2 +- ftdetect/requirements.vim | 2 +- plugin/requirements.vim | 2 +- syntax/requirements.vim | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/autoload/requirements.vim b/autoload/requirements.vim index 1110540..42c546c 100644 --- a/autoload/requirements.vim +++ b/autoload/requirements.vim @@ -1,5 +1,5 @@ " the Requirements File Format syntax support for Vim -" Version: 1.4.2 +" Version: 1.5.0 " Author: raimon " License: MIT LICENSE diff --git a/ftdetect/requirements.vim b/ftdetect/requirements.vim index a28edeb..14269b4 100644 --- a/ftdetect/requirements.vim +++ b/ftdetect/requirements.vim @@ -1,5 +1,5 @@ " the Requirements File Format syntax support for Vim -" Version: 1.4.2 +" Version: 1.5.0 " Author: raimon " License: MIT LICENSE " diff --git a/plugin/requirements.vim b/plugin/requirements.vim index 73fc81b..080f27f 100644 --- a/plugin/requirements.vim +++ b/plugin/requirements.vim @@ -1,5 +1,5 @@ " the Requirements File Format syntax support for Vim -" Version: 1.4.2 +" Version: 1.5.0 " Author: raimon " License: MIT LICENSE diff --git a/syntax/requirements.vim b/syntax/requirements.vim index cf2c408..a2edd53 100644 --- a/syntax/requirements.vim +++ b/syntax/requirements.vim @@ -1,5 +1,5 @@ " the Requirements File Format syntax support for Vim -" Version: 1.4.2 +" Version: 1.5.0 " Author: raimon " License: MIT LICENSE From 63c5ce97eb512aec5f55d63cca241c6c92a52286 Mon Sep 17 00:00:00 2001 From: raimon Date: Thu, 22 Mar 2018 02:23:57 +0900 Subject: [PATCH 6/6] Add full text of license for redistribution --- autoload/requirements.vim | 21 +++++++++++++++++++++ ftdetect/requirements.vim | 20 ++++++++++++++++++++ plugin/requirements.vim | 21 +++++++++++++++++++++ syntax/requirements.vim | 21 +++++++++++++++++++++ 4 files changed, 83 insertions(+) diff --git a/autoload/requirements.vim b/autoload/requirements.vim index 42c546c..e5234fc 100644 --- a/autoload/requirements.vim +++ b/autoload/requirements.vim @@ -2,6 +2,27 @@ " Version: 1.5.0 " Author: raimon " License: MIT LICENSE +" The MIT License (MIT) +" +" Copyright (c) 2015 raimon +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to deal +" in the Software without restriction, including without limitation the rights +" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +" copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in all +" copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +" SOFTWARE. let s:save_cpo = &cpo set cpo&vim diff --git a/ftdetect/requirements.vim b/ftdetect/requirements.vim index 14269b4..7f9ac2b 100644 --- a/ftdetect/requirements.vim +++ b/ftdetect/requirements.vim @@ -2,7 +2,27 @@ " Version: 1.5.0 " Author: raimon " License: MIT LICENSE +" The MIT License (MIT) " +" Copyright (c) 2015 raimon +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to deal +" in the Software without restriction, including without limitation the rights +" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +" copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in all +" copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +" SOFTWARE. if !exists('g:requirements#detect_filename_pattern') let g:requirements#detect_filename_pattern = '' endif diff --git a/plugin/requirements.vim b/plugin/requirements.vim index 080f27f..6627d51 100644 --- a/plugin/requirements.vim +++ b/plugin/requirements.vim @@ -2,6 +2,27 @@ " Version: 1.5.0 " Author: raimon " License: MIT LICENSE +" The MIT License (MIT) +" +" Copyright (c) 2015 raimon +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to deal +" in the Software without restriction, including without limitation the rights +" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +" copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in all +" copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +" SOFTWARE. if exists('g:loaded_requirements') finish diff --git a/syntax/requirements.vim b/syntax/requirements.vim index a2edd53..a9e8078 100644 --- a/syntax/requirements.vim +++ b/syntax/requirements.vim @@ -2,6 +2,27 @@ " Version: 1.5.0 " Author: raimon " License: MIT LICENSE +" The MIT License (MIT) +" +" Copyright (c) 2015 raimon +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to deal +" in the Software without restriction, including without limitation the rights +" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +" copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in all +" copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +" SOFTWARE. if exists("b:current_syntax") && b:current_syntax == "requirements" finish