AttributeError in check-builtin-literals hook.
See original GitHub issueThe check-builtin-literals
hook is consistently failing for me, but I don’t know why. This is the error I’m getting:
Check builtin type constructor use.......................................Failed
hookid: check-builtin-literals
Traceback (most recent call last):
File "/Users/nmford/.cache/pre-commit/repoco9z7yr8/py_env-python3.6/bin/check-builtin-literals", line 11, in <module>
sys.exit(main())
File "/Users/nmford/.cache/pre-commit/repoco9z7yr8/py_env-python3.6/lib/python3.6/site-packages/pre_commit_hooks/check_builtin_literals.py", line 79, in main
allow_dict_kwargs=args.allow_dict_kwargs,
File "/Users/nmford/.cache/pre-commit/repoco9z7yr8/py_env-python3.6/lib/python3.6/site-packages/pre_commit_hooks/check_builtin_literals.py", line 52, in check_file_for_builtin_type_constructors
visitor.visit(tree)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ast.py", line 253, in visit
return visitor(node)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ast.py", line 261, in generic_visit
self.visit(item)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ast.py", line 253, in visit
return visitor(node)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ast.py", line 261, in generic_visit
self.visit(item)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ast.py", line 253, in visit
return visitor(node)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ast.py", line 261, in generic_visit
self.visit(item)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ast.py", line 253, in visit
return visitor(node)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ast.py", line 263, in generic_visit
self.visit(value)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ast.py", line 253, in visit
return visitor(node)
File "/Users/nmford/.cache/pre-commit/repoco9z7yr8/py_env-python3.6/lib/python3.6/site-packages/pre_commit_hooks/check_builtin_literals.py", line 38, in visit_Call
if node.func.id not in set(BUILTIN_TYPES).difference(self.ignore):
AttributeError: 'Call' object has no attribute 'id'
This is how the config yaml is configured:
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 805530fe2934a55dc399f80615725157dec5f062
hooks:
- id: check-ast
- id: check-builtin-literals # Seems to have an issue in the library
- id: detect-private-key
- id: end-of-file-fixer
- id: flake8
args: [--max-line-length=120]
exclude: '(smoke_)?specs\/'
- id: mixed-line-ending
- id: name-tests-test
args: [--django]
- id: requirements-txt-fixer
- id: trailing-whitespace
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
AttributeError using hooks in Requests Python package
I am sending requests and receiving their response objects into a hooked function. Sometimes, I'm sending a new request out of that same ......
Read more >How to Fix AttributeError in Python - Rollbar
The Python AttributeError is an exception that occurs when an attribute reference or assignment fails. Learn how to fix it.
Read more >module 'pytest' has no attribute 'hookimpl'" running tests in ...
"AttributeError: module 'pytest' has no attribute 'hookimpl'" running tests in PyCharm · Open two Python projects in the same PyCharm window. · In...
Read more >'NoneType' object has no attribute 'register_forward_hook'
I'm trying to register a forward hook function to the last conv layer of my network. ... AttributeError: 'NoneType' object has no attribute...
Read more >Developing QGIS plugin: AttributeError: object has no attribute
I tested and it works just fine. However, I can't get the geocode with web service to work for now. The UI is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Woo! Thanks for the fix!
On Mon, May 28, 2018 at 10:40 AM, Anthony Sottile notifications@github.com wrote:
This has been (finally!) released as part of v1.3.0! 🎉