Giter Site home page Giter Site logo

Comments (4)

cd-work avatar cd-work commented on August 24, 2024

I'd argue this is expected behavior. You're telling the lockfile generator to parse a file and saying that no lockfile generation should be performed. So if the file is a valid lockfile but the contents aren't a valid lockfile, shouldn't we error out?

Like what do you suggest should happen if the manifest's content is actually invalid and it's a lockfile? How are we to detect that it failed because it is a manifest, when we have no way to determine it is one?

from cli.

maxrake avatar maxrake commented on August 24, 2024

I'd argue this is expected behavior. You're telling the lockfile generator to parse a file and saying that no lockfile generation should be performed. So if the file is a valid lockfile but the contents aren't a valid lockfile, shouldn't we error out?

Having --no-generation specified does not automatically mean the dependency file is a known lockfile. It could still be a manifest. Erroring out is still expected...but with a specific error code (20) and a message that explains what happened instead of a parsing stack trace.

Like what do you suggest should happen if the manifest's content is actually invalid and it's a lockfile? How are we to detect that it failed because it is a manifest, when we have no way to determine it is one?

The current lockfile generation documentation for lockifests states:

Phylum handles these files by first attempting to analyze them as a lockfile. If anything in the file is not fully specified, this will fail, and Phylum will silence the error and proceed to lockfile generation.

The suggestion here for what should happen is a modification to say:

Phylum handles these files by first attempting to analyze them as a lockfile. If anything in the file is not fully specified, this will fail, and Phylum will silence the error and proceed to lockfile generation unless lockfile generation is suppressed (e.g., via --no-generation option). In that case, error code 20 will be returned along with a message explaining how the lockifest could not be parsed as a lockfile and requires lockfile generation to parse as a manifest, but lockfile generation was disabled through the CLI.

That is likely too wordy to use in the final documentation update, but the intent is hopefully more clear.

from cli.

maxrake avatar maxrake commented on August 24, 2024

Just to clarify, your complaint here is simply about the error code, correct?

Yes...the error code and the inscrutable output.

from cli.

cd-work avatar cd-work commented on August 24, 2024

That is likely too wordy to use in the final documentation update, but the intent is hopefully more clear.

Yeah at that point reading the documentation just becomes a chore.

I also do not believe we should return error code 20 in this case. It doesn't make any sense when we cannot determine the cause of the failure.

from cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.