3

When I want to commit my changes in the .pre-commit-config.yaml, I get the following error:

An error has occurred: InvalidConfigError: 
==> File .pre-commit-config.yaml
=====> while parsing a block mapping
  in "<unicode string>", line 33, column 3
did not find expected key
  in "<unicode string>", line 34, column 3
Check the log at /Users/name/.cache/pre-commit/pre-commit.log

The lines 33+ are:

- repo: local
  - id: pytest
    name: Run tests (pytest)
    entry: pytest -x
    language: system
    types: [python]
    pass_filenames: false
torek
  • 448,244
  • 59
  • 642
  • 775
felice
  • 1,185
  • 1
  • 13
  • 27

1 Answers1

1

I missed adding "hooks" to the file, now it works:

- repo: local
  hooks:  # <- this was missing
  - id: pytest
    name: Run tests (pytest)
    entry: pytest -x
    language: system
    types: [python]
    pass_filenames: false
felice
  • 1,185
  • 1
  • 13
  • 27