mirror of
https://github.com/lilydjwg/nvchecker.git
synced 2025-03-10 06:14:02 +00:00
add the exclude_regex
list option
This commit is contained in:
parent
5b47391af0
commit
e5d52a9762
2 changed files with 12 additions and 0 deletions
|
@ -200,6 +200,12 @@ include_regex
|
||||||
Only consider version strings that match the given regex. The whole string
|
Only consider version strings that match the given regex. The whole string
|
||||||
should match the regex. Be sure to use ``.*`` when you mean it!
|
should match the regex. Be sure to use ``.*`` when you mean it!
|
||||||
|
|
||||||
|
exclude_regex
|
||||||
|
Don't consider version strings that match the given regex. The whole string
|
||||||
|
should match the regex. Be sure to use ``.*`` when you mean it! This option
|
||||||
|
has higher precedence that ``include_regex``; that is, if matched by this
|
||||||
|
one, it's excluded even it's also matched by ``include_regex``.
|
||||||
|
|
||||||
sort_version_key
|
sort_version_key
|
||||||
Sort the version string using this key function. Choose between
|
Sort the version string using this key function. Choose between
|
||||||
``parse_version`` and ``vercmp``. Default value is ``parse_version``.
|
``parse_version`` and ``vercmp``. Default value is ``parse_version``.
|
||||||
|
|
|
@ -47,6 +47,12 @@ def apply_list_options(versions, conf):
|
||||||
versions = [x for x in versions
|
versions = [x for x in versions
|
||||||
if pattern.fullmatch(x)]
|
if pattern.fullmatch(x)]
|
||||||
|
|
||||||
|
pattern = conf.get('exclude_regex')
|
||||||
|
if pattern:
|
||||||
|
pattern = re.compile(pattern)
|
||||||
|
versions = [x for x in versions
|
||||||
|
if not pattern.fullmatch(x)]
|
||||||
|
|
||||||
ignored = set(conf.get('ignored', '').split())
|
ignored = set(conf.get('ignored', '').split())
|
||||||
if ignored:
|
if ignored:
|
||||||
versions = [x for x in versions if x not in ignored]
|
versions = [x for x in versions if x not in ignored]
|
||||||
|
|
Loading…
Add table
Reference in a new issue