You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
extend-select = [
"W", # pycodestyle warnings"I", # isort"N", # pep8-naming"D", # pydocstyle"B", # flake8-bugbear"PYI"# flake8-pyi
]
# Group errors by file.output-format = "grouped"# Show source context of error.show-source = true# Show summary of fixes.show-fixes = true
Create a src/foo.py file with no contents.
Run ruff check and see the problematic error message.
Output
❯ ruff checkruff failed Cause: Failed to parse /Users/[...]/ruff.toml Cause: TOML parse error at line 1, column 1 |1 | extend-select = [ | ^^^^^^^^^^^^^^^^^unknown field `show-source`
The error message points to the line about extend-select when complaining about show-source as the key that is unknown. It would be better for the error to point at line 14 entirely OR, ideally, point only at show-source part of that line since that's the key in the key-value pair in the configuration file that is unknown.
The text was updated successfully, but these errors were encountered:
pradyunsg
changed the title
Misleading error hint about invalid configuration file keys
Misleading error hint about unknown configuration file keys
Jul 17, 2024
That makes sense. Although I don't think there's much that we can do about it other than writing our own toml parser. The error message comes directly from the toml crate
Version: 0.5.2
Reproduction instructions
Create a
ruff.toml
file with the contents:Create a
src/foo.py
file with no contents.Run
ruff check
and see the problematic error message.Output
The error message points to the line about
extend-select
when complaining aboutshow-source
as the key that is unknown. It would be better for the error to point at line 14 entirely OR, ideally, point only atshow-source
part of that line since that's the key in the key-value pair in the configuration file that is unknown.The text was updated successfully, but these errors were encountered: