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

no traceback on invalid python #2

Open
mgaitan opened this issue Jan 7, 2025 · 0 comments
Open

no traceback on invalid python #2

mgaitan opened this issue Jan 7, 2025 · 0 comments

Comments

@mgaitan
Copy link
Collaborator

mgaitan commented Jan 7, 2025

Using doc910 in precommit . when the input file has a syntax error, we should output the message, not a traceback,

doc901...................................................................Failed
- hook id: doc901
- exit code: 1

Traceback (most recent call last):
  File "/home/tin/lab/Shiphero-API/.venv/bin/doc901", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/tin/lab/Shiphero-API/.venv/lib/python3.12/site-packages/doc901.py", line 144, in main
    analyze_complexity_with_docstrings(
  File "/home/tin/lab/Shiphero-API/.venv/lib/python3.12/site-packages/doc901.py", line 82, in analyze_complexity_with_docstrings
    docstring_issues = {(issue["filename"], issue["noqa_row"]) for issue in issues if issue["code"].startswith("D1")}
                                                                                      ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'startswith'

(.venv) tin@morocha:~/lab/Shiphero-API$ 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant