Closed 34j closed 1 month ago
Facing the same problem..
I've tried to find out what happens, did not really get to the bottom of it. I am now using version 1.9.0
as a workaround which works as expected.
You are right, I tried it and confirmed that it does not work with 1.10.0 and works with 1.9.0. I have also tried the CLI, and the following commands seem to work correctly and I could not determine the cause.
npx -g install bibtex-tidy
bibtex-tidy --no-align test.bib
bibtex-tidy test.bib --no-align
bibtex-tidy "test.bib" "--no-align"
I stepped into pre-commit, and the command being run is
(
'~/.cache/pre-commit/reponbqhr4ak/node_env-default/bin/node',
'~/.cache/pre-commit/reponbqhr4ak/node_env-default/bin/bibtex-tidy',
*args,
file_path,
)
If I remove the ~/.cache/.../node
from the start, it works.
So the problem is that bibtex-tidy doesn’t parse its command line arguments correctly when run running it using node path/to/bibtex-tidy ...args
.
Fixed in v1.14.0 - the following should work:
repos:
- repo: https://github.com/FlamingTempura/bibtex-tidy
rev: v1.14.0
hooks:
- id: bibtex-tidy
args: ['--align=10', '--curly']
However, the file is not formatted. If
args
is not specified, it works perfectly. Simlar: #409, Related: #14