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
$ cat icn001.pyimport sys
$ ruff check --select ICN001 --config 'lint.flake8-import-conventions.extend-aliases = {"sys" = "def"}' --isolated --unsafe-fixes --fix icn001.pyerror: Fix introduced a syntax error. Reverting all changes.This indicates a bug in Ruff. If you could open an issue at: https://github.com/astral-sh/ruff/issues/new?title=%5BFix%20error%5D...quoting the contents of `icn001.py`, the rule codes ICN001, along with the `pyproject.toml` settings and executed command, we'd be very appreciative!icn001.py:1:8: ICN001 `sys` should be imported as `def` |1 | import sys | ^^^ ICN001 | = help: Alias `sys` to `def`Found 1 error.[*] 1 fixable with the --fix option.
$ ruff check --select ICN001 --config 'lint.flake8-import-conventions.aliases = {"sys" = "def"}' --isolated --unsafe-fixes --fix icn001.pyerror: invalid value 'lint.flake8-import-conventions.aliases = {"sys" = "def"}' for '--config <CONFIG_OPTION>' tip: A `--config` flag must either be a path to a `.toml` configuration file or a TOML `<KEY> = <VALUE>` pair overriding a specific configuration optionCould not parse the supplied argument as a `ruff.toml` configuration option:invalid value: string "def", expected a Python identifierin `lint`For more information, try '--help'.
There is still one problem with lint.flake8-import-conventions.aliases, and therefore also extend-aliases: they allow __debug__ as an alias, but that is a syntax error.
Ruff 0.8.0 does not validate the aliases in
lint.flake8-import-conventions.extend-aliases
forunconventional-import-alias
(ICN001).The extra aliases should be validated like the ones in
lint.flake8-import-conventions.aliases
(#14477).There is still one problem with
lint.flake8-import-conventions.aliases
, and therefore alsoextend-aliases
: they allow__debug__
as an alias, but that is a syntax error.The text was updated successfully, but these errors were encountered: