python-trio / python-trio/flake8-async

helpful error message if parser crashes (e.g. due to syntax changes from future python version)

Open
#304 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Python
Stars
26
Forks
10
PR merge metrics
No merged PRs in 30d

Description

Trying to run the linter on py<3.11 on code using except* crashes noisily with a SyntaxError. While fairly easy to figure out what went wrong we could wrap ast.parse in a try: except SyntaxError and print a somewhat more helpful message, and continue analyzing the other files.
And ofc if a file straight up has syntax errors.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the linter's ast.parse call and read how file-processing errors are handled. Make syntax errors produce a helpful message and allow analysis to continue for other files, then verify the behavior with code using except* and with a file containing ordinary syntax errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.