check-builtin-literals: Ignore function attribute calls
diff --git a/pre_commit_hooks/check_builtin_literals.py b/pre_commit_hooks/check_builtin_literals.py
index 1213288..c4ac969 100644
--- a/pre_commit_hooks/check_builtin_literals.py
+++ b/pre_commit_hooks/check_builtin_literals.py
@@ -30,6 +30,11 @@
return self.allow_dict_kwargs and (getattr(node, 'kwargs', None) or getattr(node, 'keywords', None))
def visit_Call(self, node):
+ if isinstance(node.func, ast.Attribute):
+ # Ignore functions that are object attributes (`foo.bar()`).
+ # Assume that if the user calls `builtins.list()`, they know what
+ # they're doing.
+ return
if node.func.id not in set(BUILTIN_TYPES).difference(self.ignore):
return
if node.func.id == 'dict' and self._check_dict_call(node):