cli icon indicating copy to clipboard operation
cli copied to clipboard

Directories detected as lockfiles

Open kylewillmon opened this issue 2 years ago • 1 comments

Lockfile detection believes that directories might be lockfiles.

How To Reproduce

> mkdir requirements.txt

> ls
requirements.txt

> phylum parse
Generating lockfile for manifest "./requirements.txt" using Pip…
❗ Error: Lockfile generation failed! For details, see: https://docs.phylum.io/docs/lockfile-generation

Caused by:
    package manager exited with error code 1:

    ERROR: Could not open requirements file: [Errno 21] Is a directory: '/path/to/requirements.txt'

This error message isn't very helpful....

> mkdir Cargo.lock

> phylum parse
❗ Error: Is a directory (os error 21)

kylewillmon avatar Aug 08 '23 18:08 kylewillmon

https://github.com/phylum-dev/cli/pull/1202 as a solution was discarded, since even checking for !is_directory still causes syscalls to lookup metadata for every lockfile, even if it doesn't cause failure for the GitHub App. Since this has never caused any issues in practice, there's no reason to slow down the GitHub App.

cd-work avatar Aug 18 '23 16:08 cd-work