Coder Social home page Coder Social logo

Comments (6)

x1ddos avatar x1ddos commented on June 26, 2024

#25 added a -v flag (verbose) to print files which are modified. You could use it to achieve the same effect.

But all that wouldn't help much in a CI environment because what you really want is a more clear signal to indicate whether at least one file is missing a license. You wouldn't want to inspect the output every time, especially in automated scripts and CIs.

What you probably want is for addlicense to exit with a specific code if at least 1 file missing a license. Then you could easily use that in hooks and CIs.

from addlicense.

x1ddos avatar x1ddos commented on June 26, 2024

OTOH it isn't clear what zero exit code would mean then. Is it "ok, all files already have a license; none were modified" or "ok, added license where missing; all files now have a license".

Currently, there's no distinction and zero exit code simply means: ok, all files known to the program have a license now regardless of whether any of them were modified.

from addlicense.

mithun avatar mithun commented on June 26, 2024

#25 added a -v flag (verbose) to print files which are modified. You could use it to achieve the same effect

Well, not really. The -v flag is still potentially modifying files.

What you probably want is for addlicense to exit with a specific code if at least 1 file missing a license. Then you could easily use that in hooks and CIs.

Yes.

Currently, there's no distinction and zero exit code simply means: ok, all files known to the program have a license now regardless of whether any of them were modified.

I agree.

This issue is for a new flag --check (or something appropriately named) that implements the following behavior: Running addlicense --check <pattern> must:

  • Never modify any files
  • Exit with zero (success) if all files in <pattern> have a license
  • Exit with non-zero (failure, exit code 1) if at least one file in the <pattern> requires modification to include a license text. Additionally, print such files to STDOUT.

from addlicense.

x1ddos avatar x1ddos commented on June 26, 2024

Yeah, that's precisely it. Would you mind sending a pull request?

from addlicense.

x1ddos avatar x1ddos commented on June 26, 2024

Yeah, that's precisely it. Would you mind sending a pull request?

from addlicense.

mithun avatar mithun commented on June 26, 2024

@x1ddos PR #29 is submitted

from addlicense.

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.