New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add poetry.lock as toml #280
Conversation
identify/extensions.py
Outdated
'pylintrc': EXTENSIONS['ini'] | {'pylintrc'}, | ||
'README': EXTENSIONS['txt'], | ||
'Rakefile': EXTENSIONS['rb'], | ||
'setup.cfg': EXTENSIONS['ini'], | ||
'WORKSPACE': EXTENSIONS['bzl'], | ||
'wscript': EXTENSIONS['py'], | ||
'yarn.lock': {'text'}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't improve the identification -- it will get text
already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I oriented this change on the Gemfile.lock entry:
identify/identify/extensions.py
Line 300 in 939e9c9
'Gemfile.lock': {'text'}, |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.