Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Verify searched license locations #4

Closed
danbev opened this issue Jun 22, 2017 · 11 comments
Closed

Verify searched license locations #4

danbev opened this issue Jun 22, 2017 · 11 comments
Assignees
Labels

Comments

@danbev
Copy link
Collaborator

danbev commented Jun 22, 2017

This task should verify that all the following locations are searched for licence files:

  • package.json file checked first for the tag
  • then check README
  • then check file with LICENSE in its name
  • then check file with COPYING in its name

This should be done be creating a unit test and a mock/dummy project with licenses in the above mentioned locations.

@helio-frota
Copy link
Member

@danbev seems the current module we are using to search licenses, has some limitations related
to this task.

  1. when the code finds a license then stop searching on another files
    e.g: license found on COPYING, then not show LICENSE.
    the property licenseFile is used to this.

the result is only:

 { '[email protected]': 
       { licenses: 'MIT',
         publisher: 'foo',
         licenseFile: '/full path here/sample_project/COPYING' } }
  1. Not able to search on README.
    I mean when using only README (or README.md) it shows always:
    { '[email protected]': { licenses: 'MIT', publisher: 'foo' } } without
    licenseFile property.

@danbev
Copy link
Collaborator Author

danbev commented Jun 29, 2017

@helio-frota Great, exactly what we wanted to find out.

We can either take a look at an alternative existing license search implementation or perhaps we should write our own for our specific needs. Would you be willing to take a look if there are any other license searching options out there that might fit our needs, and if there are none create an issue for this. We can still make progress on other issue I think but this would be the highest priority one I think.

@helio-frota
Copy link
Member

@danbev yah sounds good .

@helio-frota
Copy link
Member

helio-frota commented Jun 30, 2017

The tool can find the license from README.md or README when no 'license' property found on package.json.

But still not showing the licenseFile property, the result is
{ '[email protected]': { licenses: 'MIT*' } } with *

-> Maybe <- we can add this property on resulting json, assuming that:

"when no licenseFile, and *, then means the license was found on README"

@helio-frota
Copy link
Member

Also, I'm going to try to make some workaround related to the "Find -> found - > stop searching" behavior.
because we need to continue to satisfy the task

This task should verify that all the following locations are searched for licence files...

not only one place.

@helio-frota
Copy link
Member

here we have README on licenseFile:
https://github.com/helio-frota/license-checker/tree/licensefile-readme

sample output:

 { '[email protected]': 
       { licenses: 'MIT*',
         licenseFile: '/full path here/sample_dependency/README' } }

@helio-frota
Copy link
Member

we need to solve 1 remaining thing:

to show all license file locations, and not only one file license location.

With the small previous change, when the package.json has license property the README is shown on licenseFile .

@helio-frota
Copy link
Member

@danbev

"This task should verify that all the following locations are searched for licence files:"

This means, only to search, I mean to guarantee that it was searched, or means to output also ?

if this is to ensure that it was searched then we can close this issue and use my fork (and of course I'll send a PR to the original repository)

@danbev
Copy link
Collaborator Author

danbev commented Jul 5, 2017

This means, only to search, I mean to guarantee that it was searched, or means to output also ?

I only head verifying in mind and that we'd create a new issue for anything that we discover is missing, like you have done.

Like you said we should probably send a PR upstream and also create a new task so that we can extract the contents of the licence in the README. This is needed because at the moment the entire README will be include in the xml element. Does that make sense?

@helio-frota
Copy link
Member

davglass/license-checker#106

@helio-frota
Copy link
Member

this PR covers this task with some tests:
#38

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants