Skip to content

Report line number for invalid config file error #783

@j178

Description

@j178

From discord channel, @ashb writes:

prek 0.2.1 is reporting errors from the wrong place. This file

minimum_prek_version: '0.2.1'
repos:
  - repo: 'https://github.com/pre-commit/pre-commit-hooks'
    rev: v5.0.0
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: check-yaml
      - id: check-added-large-files
  - repo: local
    hooks:
      - id: protoc
        language: docker_image
        entry: --entrypoint bash rvolosatovs/protoc -c 'sleep 600'

reports

error: Failed to parse .pre-commit-config.yaml
caused by: repos: Invalid local repo: missing field name at line 3 column 3
but the error is on the lack of name on the local hook, but it's not line 3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions