Skip to content

Change the error report style to file:line:column #3157

Description

@ptsl

Currently, the following error message is produced if Black fails to format a file:

error: cannot format foo/bar.py: Cannot parse: 1187:8:         text = "xyzzy"
Oh no! 💥 💔 💥
1 file failed to reformat.

Modern editors support the file:line syntax, and even some of them the file:line:column syntax.

For example, Sublime Text:

$ subl -h
...
Filenames may be given a :line or :line:column suffix to open at a specific
location.

Please, change the error message to:

error: cannot parse: foo/bar.py:1187:8:         text = "xyzzy"
Oh no! 💥 💔 💥
1 file failed to reformat.

This will make it easier to copy the file name together with line and column numbers a paste them on the command line for subl.

Metadata

Metadata

Assignees

No one assigned

    Labels

    S: acceptedThe changes in this design / enhancement issue have been accepted and can be implementedT: enhancementNew feature or request

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions