Giter VIP home page Giter VIP logo

Comments (11)

yeldiRium avatar yeldiRium commented on July 28, 2024 2

@rotespferd this issue is resolved in roboter version 12.1.0 with the update of the dependency npm-package-json-lint-config-tnw to version 1.1.0. If in the future you choose to use a license that is not intended to be used by the config, you need to override that rule yourself.

from roboter.

goloroden avatar goloroden commented on July 28, 2024

Hey @rotespferd πŸ‘‹

Thanks for bringing this up, we are going to investigate what the problem is and may come back with additional questions to you.

from roboter.

goloroden avatar goloroden commented on July 28, 2024

Okay, I've tried this with a simple example, and I was not able to reproduce this behavior. Can you please provide a sample repository?

from roboter.

rotespferd avatar rotespferd commented on July 28, 2024

I created the following package.json, which reproduces the error for me:
https://gist.github.com/rotespferd/f34e703ff67109d225819567c311de91

from roboter.

goloroden avatar goloroden commented on July 28, 2024

If I take this package.json file, run npm install. and then run npx roboter license, it works 😳

from roboter.

rotespferd avatar rotespferd commented on July 28, 2024

This is strange :-D

I looked into the code of roboter. It seams to me that the license check compare the license field of the package.json against the licenses in the file "licenseCheck.json".
The array "compatibleLicenses" in this file does not contain the AGPL. So in my understanding the license check failed because the AGPL is not in the file.

from roboter.

goloroden avatar goloroden commented on July 28, 2024

Basically, what we do is that we compare the license given in the package.json file against those defined in the licenseCheck.json file. If there are any incompatibilities, you will get a license error.

However, the error message you provided does not say that there is an incompatible license, but that the package.json file is broken – and this is what I can not reproduce.

from roboter.

rotespferd avatar rotespferd commented on July 28, 2024

Ok, sorry, that was my fault. I misunderstood the logic of the code.

What happens if you run npx roboter analyze with the given package.json?
The problem seems to be in the linting part of the "package.json". roboter uses the module "npm-package-json-lint" for this. "npm-package-json-lint" validates the content of the license field against which licenses are configured in ".npmpackagejsonlintrc" in the property "valid-values-license" (see documentation).

Roboter extends the config of the file "npm-package-json-lint-config-tnw/app.json", which basically extends "npm-package-json-lint-config-tnw/base.json". In base.json you only allow the MIT license. So every other license produces an error. For testing purpose I inserted the GPL in the license field, which also produces an error. Only when I put the MIT license in the field everything runs without an error.

(To rule out that the error is due to my environment I tested everything which a freshly installed Linux environment with the latest Node version)

from roboter.

yeldiRium avatar yeldiRium commented on July 28, 2024

@rotespferd you are entirely correct. The issue here is the npm-package-json-lint configuration which does not allow the license you are using. This is not an issue with the license command.

This was originally done in the npm-package-json-lint configuration since we use the MIT license for almost everything, but that has since caused other issues and thus other licenses were added (e.g. your ALPG-3.0-or-later).

If you want to use another license that is not present in the npm-package-json-lint configuration, you can overwrite that rule. You found the documentation on that yourself, so I won't elaborate on this :)

The package npm-package-json-lint-config-tnw unfortunately has not yet been updated in the roboter, since we're having CI issues. I'll notify you here once the new version is contained and this issue will be resolved.

from roboter.

goloroden avatar goloroden commented on July 28, 2024

@rotespferd Sorry for not having replied back earlier, I had a few days off.

The mistake was on my side – I actually forgot to add a .npmpackagejsonlintrc file to the project I have been testing with. If I add one, I get the same error that you got. Sorry for that 😞

As @yeldiRium already pointed out we updated the underlying package accordingly, but have a few problems releasing a new version of roboter. As soon as this is done the problems should be gone.

from roboter.

rotespferd avatar rotespferd commented on July 28, 2024

Thank you guys for your work!
Now it is working for me.

from roboter.

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.