Skip to content

Commit

Permalink
Fix quoted strings for new flake8-quote check.
Browse files Browse the repository at this point in the history
Note that for generated code, we unconditionally disable the
flake8-quote check Q003 (Change outer quotes to avoid escaping
inner quotes).  For non-string types, this will have no effect.
For string types, it could be fairly expensive to scan strings
for single or double quotes.  The expense just doesn't seem
worth it and the resulting return value won't be exactly what
the user typed into their .msg file.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
  • Loading branch information
clalancette committed Apr 18, 2019
1 parent e905f75 commit 38ae9c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rosidl_generator_py/test/test_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ def test_default_values():
assert 'Hello world!' == Strings.DEF_STRING__DEFAULT
assert 'Hello world!' == a.DEF_STRING__DEFAULT

assert 'Hello\'world!' == a.DEF_STRING2__DEFAULT
assert "Hello'world!" == a.DEF_STRING2__DEFAULT
assert 'Hello"world!' == a.DEF_STRING3__DEFAULT
assert 'Hello\'world!' == a.DEF_STRING4__DEFAULT
assert "Hello'world!" == a.DEF_STRING4__DEFAULT
assert 'Hello"world!' == a.DEF_STRING5__DEFAULT
with pytest.raises(AttributeError):
setattr(Strings, 'DEF_STRING__DEFAULT', 'bar')
Expand Down

0 comments on commit 38ae9c1

Please sign in to comment.