Skip to content

Commit

Permalink
Mute warnings
Browse files Browse the repository at this point in the history
*CLOUDBLD-72

Signed-off-by: Salatskyi Serhii <ssalatsk@redhat.com>
  • Loading branch information
Salatskyi Serhii authored and MartinBasti committed Apr 27, 2020
1 parent 711b5ce commit 470e2d8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
5 changes: 4 additions & 1 deletion dockerfile_parse/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def _create_instruction_dict(instruction=None, value=None):
'instruction': instruction,
'startline': lineno,
'endline': lineno,
'content': line,
'content': line, # pylint: disable=undefined-loop-variable
'value': value
}

Expand Down Expand Up @@ -271,10 +271,13 @@ def _clean_comment_line(line):
else:
current_instruction['content'] += line
current_instruction['endline'] = lineno

# pylint: disable=unsupported-assignment-operation
if current_instruction['value']:
current_instruction['value'] += _rstrip_backslash(line)
else:
current_instruction['value'] = _rstrip_backslash(line.lstrip())
# pylint: enable=unsupported-assignment-operation

in_continuation = contre.match(line)
if not in_continuation and current_instruction is not None:
Expand Down
4 changes: 0 additions & 4 deletions dockerfile_parse/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ def b2u(string):

def u2b(string):
""" unicode to bytes"""
<<<<<<< HEAD
if isinstance(string, six.text_type):
=======
if isinstance(string, text_type):
>>>>>>> 96a082b... fix error
return string.encode('utf-8')
return string

Expand Down
7 changes: 4 additions & 3 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

NON_ASCII = "žluťoučký"
# flake8 does not understand fixtures:
dfparser = dfparser
instruction = instruction
dfparser = dfparser # pylint: disable=self-assigning-variable
instruction = instruction # pylint: disable=self-assigning-variable


class TestDockerfileParser(object):
Expand Down Expand Up @@ -298,6 +298,7 @@ def test_get_parent_env_from_scratch(self, tmpdir):
assert not df1.envs

@pytest.mark.parametrize(('instr_value', 'expected'), [
# pylint: disable=anomalous-backslash-in-string
('"name1"=\'value 1\' "name2"=myself name3=""',
{'name1': 'value 1',
'name2': 'myself',
Expand Down Expand Up @@ -989,7 +990,7 @@ def test_label_invalid(self, dfparser, label_value, bad_keyval, envs, action):
]
with pytest.raises(ValueError) as exc_info:
if action == 'get':
dfparser.labels
dfparser.labels # pylint: disable=pointless-statement
elif action == 'set':
dfparser.labels = {}
if six.PY2:
Expand Down

0 comments on commit 470e2d8

Please sign in to comment.