Open yiliu30 opened 1 month ago
https://docs.astral.sh/ruff/rules/banned-import-from/
[lint.flake8-import-conventions]
# Declare the banned `from` imports.
banned-from = ["os.path", "numpy", "pandas", "numbers.util"]
# "numpy", "pandas" are defaults
# https://github.com/joaopalmeiro/flake8-import-conventions?tab=readme-ov-file#flake8-codes
ruffimport:
ruff check --select ICN
rufffiximport:
ruff check --select ICN --unsafe-fixes --fix
Rule to enforce import module only #3045 https://github.com/astral-sh/ruff/issues/3045 Implement flake8-import-restrictions #5841 https://github.com/astral-sh/ruff/issues/5841
https://google.github.io/styleguide/pyguide.html#22-imports