Skip to content

pre-commit fails with TypeError #1475

@kbehlers

Description

@kbehlers

When I attempt to run the pre-commit command, I get a TypeError.

If I modify this line

DEPRECATED_SETTINGS = ("not_skip", "keep_direct_and_as_imports")

# DEPRECATED_SETTINGS = ("not_skip", "keep_direct_and_as_imports")
DEPRECATED_SETTINGS = ("not_skip", "keep_direct_and_as_imports", "apply")

then the command works.

So it seems somewhere along the line the combined_config from /isort/settings.py is picking up the deprecated --apply flag and passing it.

python3.8
pre-commit==2.7.1

# .pre-commit-config.yaml
default_language_version:
    python: python3.8
repos:
  - repo: https://github.com/pycqa/isort
    rev: '5.5.2'
    hooks:
      - id: isort
Traceback (most recent call last):
  File "/Users/k/.cache/pre-commit/repoccvi_m_m/py_env-python3.8/bin/isort", line 8, in <module>
    sys.exit(main())
  File "/Users/k/.cache/pre-commit/repoccvi_m_m/py_env-python3.8/lib/python3.8/site-packages/isort/main.py", line 830, in main
    config = Config(**config_dict)
  File "/Users/k/.cache/pre-commit/repoccvi_m_m/py_env-python3.8/lib/python3.8/site-packages/isort/settings.py", line 426, in __init__
    super().__init__(sources=tuple(sources), **combined_config)  # type: ignore
TypeError: __init__() got an unexpected keyword argument 'apply'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions