Skip to content

Commit

Permalink
Merge pull request #1629 from ESMCI/jgfouca/pylint_fixes_and_more
Browse files Browse the repository at this point in the history
Fix a couple pylint issues.

Fix a critical problem in code_checker that caused it to filter too
many files.

Test suite: pylint, unit-tests
Test baseline:
Test namelist changes:
Test status: bit for bit

Fixes [CIME Github issue #]

User interface changes?: None

Code review: None
  • Loading branch information
jgfouca authored May 31, 2017
2 parents 6a7ffc2 + 8828854 commit 37e4ed7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions scripts/lib/CIME/XML/machines.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self, infile=None, files=None, machine=None):
# Append the contents of $HOME/.cime/config_machines.xml if it exists
# This could cause problems if node matchs are repeated when only one is expected
local_infile = os.path.join(os.environ.get("HOME"),".cime","config_machines.xml")
logger.debug("Infile: {}" , local_infile)
logger.debug("Infile: {}".format(local_infile))
if os.path.exists(local_infile):
GenericXML.read(self, local_infile, schema)

Expand Down Expand Up @@ -211,7 +211,7 @@ def get_field_from_list(self, listname, reqval=None, attributes=None):

expect(supported_values is not None,
"No list found for " + listname + " on machine " + self.machine)
supported_values = supported_values.split(",")
supported_values = supported_values.split(",") #pylint: disable=no-member

if reqval is None or reqval == "UNSET":
return supported_values[0]
Expand Down
4 changes: 2 additions & 2 deletions scripts/lib/CIME/code_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ def _matches(file_path, file_ends):
def _should_pylint_skip(filepath):
###############################################################################
# TODO - get rid of this
list_of_directories_to_ignore = ("xmlconvertors", "pointclm", "point_clm", "tools", "machines", "apidocs")
list_of_directories_to_ignore = ("xmlconvertors", "pointclm", "point_clm", "tools", "machines", "apidocs", "doc")
for dir_to_skip in list_of_directories_to_ignore:
if dir_to_skip in filepath:
if dir_to_skip + "/" in filepath:
return True

return False
Expand Down
2 changes: 1 addition & 1 deletion scripts/lib/CIME/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def run_cmd_no_fail(cmd, input_str=None, from_dir=None, verbose=None,
>>> run_cmd_no_fail('echo THE ERROR >&2; false')
Traceback (most recent call last):
...
SystemExit: ERROR: Command: 'echo THE ERROR >&2; false' failed with error 'THE ERROR'
SystemExit: ERROR: Command: 'echo THE ERROR >&2; false' failed with error 'THE ERROR' from dir '/home/jgfouca/cime_yetanother/scripts/lib/CIME'
>>> run_cmd_no_fail('grep foo', input_str='foo')
'foo'
Expand Down

0 comments on commit 37e4ed7

Please sign in to comment.