Skip to content

tool/format_ignores.py does not support multiple files, breaking lefthook #409

@jorenham

Description

@jorenham

Example lefthook output I saw when commit my changes in #408

> git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file - -S
╭───────────────────────────────────────╮
│ 🥊 lefthook v1.11.4  hook: pre-commit │
╰───────────────────────────────────────╯
│  markdown-lint (skip) no files for inspection
┃  ruff-check ❯ 

All checks passed!

┃  ruff-format ❯ 

�[1;33mwarning�[0m�[1m:�[0m �[1mThe following rule may cause conflicts when used with the formatter: `COM812`. To avoid unexpected behavior, we recommend disabling this rule, either by removing it from the `select` or `extend-select` configuration, or adding it to the `ignore` configuration.�[0m
5 files left unchanged

┃  ignore-format ❯ 

usage: format_ignores.py [-h] [--pattern PATTERN] [--check] [path]
format_ignores.py: error: unrecognized arguments: src/numpy-stubs/_typing/__init__.pyi src/numpy-stubs/_typing/_array_like.pyi src/numpy-stubs/_typing/_nbit.pyi src/numpy-stubs/_typing/_nbit_base.pyi

exit status 2                                      
  ────────────────────────────────────
summary: (done in 0.03 seconds)       
✔️ ruff-check
✔️ ruff-format
🥊 ignore-format

The workaround is to use git commit --no-verify, so that lefthook is skipped.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions