PyCQA / PyCQA/pyflakes

End column/lineno

Open
#454 13 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.5k
Forks
190
Avg merge
8m
Merged PRs (30d)
13

Description

It would be useful to have end_col and end_lineno attributes on Message objects. The way it would work is that (col, lineno) to (end_col, end_lineno) would represent the range of characters for the error. For instance, for undefined names, the col, lineno already points to the first character, and the end versions would point to the last character in the word.

I haven't looked yet how easy this is to implement. I wanted to post it here to see if anyone had any thoughts. I might make a pull request for it later (time permitting).

Contributor guide

No contributing guide indexed for this repository

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

Start by tracing Message objects and the existing col and lineno handling in pyflakes, then inspect how undefined-name errors identify the first character of a word. The work is done when Message objects expose end_col and end_lineno that mark the end of the reported character range, including undefined names.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.