Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent flake8-builtins A003 #6

Merged
merged 2 commits into from
Jul 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions rosidl_generator_py/resource/_msg.py.em
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,19 @@ class @(spec.base_type.type)(metaclass=Metaclass):
return True
@[for field in spec.fields]@

@@property
@{
import inspect
import builtins
noqa_string = ''
if field.name in dict(inspect.getmembers(builtins)).keys():
noqa_string = ' # noqa: A003'
}@
@@property@(noqa_string)
def @(field.name)(self):
"""Message field '@(field.name)'."""
return self._@(field.name)

@@@(field.name).setter
@@@(field.name).setter@(noqa_string)
def @(field.name)(self, value):
if __debug__:
@[ if not field.type.is_primitive_type()]@
Expand Down