Skip to content

ImportError: cannot import name 'clang_format' from 'clang_format' (unknown location) #108

@shenxianpeng

Description

@shenxianpeng
pre-commit run --all-files
clang-format.............................................................Failed
- hook id: clang-format
- exit code: 1

Traceback (most recent call last):
  File "/home/sxp/.local/bin/clang-format", line 3, in <module>
    from clang_format import clang_format
ImportError: cannot import name 'clang_format' from 'clang_format' (unknown location)
Traceback (most recent call last):
  File "/home/sxp/.local/bin/clang-format", line 3, in <module>
    from clang_format import clang_format
ImportError: cannot import name 'clang_format' from 'clang_format' (unknown location)

The .pre-commit-config.yaml file as below:

# .pre-commit-config.yaml
repos:
  - repo: https://github.com/cpp-linter/cpp-linter-hooks
    rev: v1.1.0
    hooks:
      - id: clang-format
        args: [--style=file, --version=21]

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions