Skip to content

Commit

Permalink
Merge branch 'release/v1.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Nunes committed Jun 11, 2016
2 parents ae0efb0 + 848a52c commit b992527
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ Changelog
=========


1.4.0 (2016-06-11)

* Warnings should now report mismatches flag labels and values as well.


----------------------------------


1.3.0 (2016-06-08)

* Warnings should now report empty installers.
Expand Down
25 changes: 20 additions & 5 deletions fomod/validator/warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,25 @@ def check_warnings(package_path, elem_tree=None, ignore_errors=False):
"Empty Installer",
"The installer is empty - it does nothing, literally!",
lambda **kwargs: not [elem for elem in kwargs["elem"]
if elem.tag == "moduleDependencies" or
elem.tag == "requiredInstallFiles" or
elem.tag == "installSteps" or
elem.tag == "conditionalFileInstalls"])]
if elem.tag == "moduleDependencies" or
elem.tag == "requiredInstallFiles" or
elem.tag == "installSteps" or
elem.tag == "conditionalFileInstalls"]),
_WarningElement(config_root,
("flagDependency",),
"Mismatched Flag Labels",
"The flag label that {} is dependent on is never created during installation.",
lambda **kwargs: not [elem for elem in kwargs["root"].iter()
if elem.tag == "flag" and
elem.get("name") == kwargs["elem"].get("flag")]),
_WarningElement(config_root,
("flagDependency",),
"Mismatched Flag Values",
"The flag value that {} is dependent on is never set during installation.",
lambda **kwargs: not [elem for elem in kwargs["root"].iter()
if elem.tag == "flag" and
elem.get("name") == kwargs["elem"].get("flag") and
elem.text == kwargs["elem"].get("value")])]

log_list = []
for warn in element_list:
Expand Down Expand Up @@ -97,7 +112,7 @@ def __init__(self, elem_root, tags, title, error_msg, condition):

tag_result = []
for elem in tag_list:
if condition(**{"tag_list": tag_list, "elem": elem}):
if condition(**{"tag_list": tag_list, "elem": elem, "root": elem_root}):
tag_result.append(elem)

self.tag_log = _ElementLog(tag_result, title, error_msg) if tag_result else None
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.3.0
current_version = 1.4.0
current_build = 0

[bumpversion:file:setup.py]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='fomod-validator',
version='1.3.0',
version='1.4.0',
license='Apache 2.0',
description='',
long_description='',
Expand Down

0 comments on commit b992527

Please sign in to comment.