End column/lineno

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

@krassowski is already working on this.

Since Jul 17, 2021.

  • #649 by @krassowski — open

Assessment

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

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.

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).

Dominant language
Python
Stars
1.5k
Forks
207
Avg merge
4m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from PyCQA/pyflakes

All issues in PyCQA/pyflakes

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.