add poetry.lock as toml#280
Conversation
identify/extensions.py
Outdated
| 'setup.cfg': EXTENSIONS['ini'], | ||
| 'WORKSPACE': EXTENSIONS['bzl'], | ||
| 'wscript': EXTENSIONS['py'], | ||
| 'yarn.lock': {'text'}, |
There was a problem hiding this comment.
this doesn't improve the identification -- it will get text already
There was a problem hiding this comment.
I oriented this change on the Gemfile.lock entry:
identify/identify/extensions.py
Line 300 in 939e9c9
What exactly is the difference in the cases between Gemfile.lock and yarn.lock?
Furthermore, checking yarn.lock with the cli returns no result:
identify /home/janv/yarn.lock
identify: no decode delegate for this image format `LOCK' @ error/constitute.c/ReadImage/572.
But it does after the change:
identify /home/janv/yarn.lock
["file", "non-executable", "text"]
There was a problem hiding this comment.
your output is doctored, you're running imagemagick identify
the Gemfile.lock is a mistake, it seems -- it should have a more specific tag
There was a problem hiding this comment.
Oh... my bad. I had trouble getting the cli to run and got something wrong somehwhere. How about adding a __main__.py so the cli can be run with python -m identify ? I will revert the yarn.lock change.
There was a problem hiding this comment.
I mean you've kinda killed my trust -- why did you make up output?
the command is called identify-cli to disambiguate with imagemagick
There was a problem hiding this comment.
I did the stupid mistake to not read the docs/README. I know this isn't trustworthy and I want to apologize for that. I was so sure that identify was the right cli command so I stripped off the python -m before it. I didn't pay enough attention to what I was doing. Lesson learned.
However, I want to regain your trust by pointing out the code where poetry.lock is interpreted as a toml file:
https://github.com/python-poetry/poetry/blob/31657e7e5c47da758c14645035e59eb7813ac2f8/src/poetry/packages/locker.py#L53
Again, sorry for killing your trust. This was embarrassing.

I noticed that the lock files from poetry and yarn aren't in here yet. Poetry uses toml. Yarn is another story. Yarn v1 files aren't valid yaml files while Yarn v2 lock files are. I think it's better to go just with a text file here.