Skip to content

TOML parse error shows incorrect location #4060

Description

@dillydill123

Describe the Bug

I was trying out pytorch-efficiency-lints and created the following pyrefly.toml:

preset = "strict"
pytorch-efficiency-lints = "true"

Here I incorrectly used "true" instead of true. However, pyrefly incorrectly reports where the error in toml parsing occured:

$ pyrefly check example.py 
ERROR /home/dillon/sbx/demos/pyrefly/pyrefly.toml: TOML parse error at line 1, column 1
  |
1 | preset = "strict"
  | ^
invalid type: string "true", expected a boolean

Fatal configuration error

Reproducible in the sandbox, which just displays the first line as well.

Sandbox Link

https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeSIIANCGQE4xhSmEAuuAtlBQMQAEABVIMmpPmix58fAMa50kAOYBXOqlYR5hADrp%2BAZRgw%2BAC1aticRAHpr9Rs0K46i6zHTXMuGXGtyFECpqGvLWfGDOfKgAbqjQqNiwsvJKquqa6Hy4xCHocDroZKwm8gC00TB0cBl8ALx82iAAzIQAjABMjbrEDHAwrHUNIHCsdBAyrF2FpOx0MialjJAyEO4ypKVQEOiscIONo8owUyAAvjSoExAVAGLQMBQSOAQk5KdAA

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Assignees

Labels

configurationhelp wantedLarger than "good first issue", but still well-defined and ready for someone to pick up

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions