Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect licenses #1

Open
2 tasks
ksandom opened this issue Jan 27, 2020 · 0 comments
Open
2 tasks

Detect licenses #1

ksandom opened this issue Jan 27, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@ksandom
Copy link
Owner

ksandom commented Jan 27, 2020

Task

  • Find a way to detect licenses at the the beginning of files.
  • Return a description like "Rejected: license."

Background

Sometimes, people put the license of the program at the top of the script instead of the description. This is a case that we should be able to detect. Right now it's done by looking for a couple of key words. But this won't scale.

My current thinking is to

  • Build up an array of strings, which are the first line of licenses we've come across.
    • The first pass at solving this could be just two or more licenes (ie just enough to prove that the solution isn't a single hard coded string.)
    • This list will expand pretty quickly.
    • The list should be ordered in order of how frequently the licenses occur. Ie most common at the top. - Eg I'm guessing this will be a GPL of some form.
  • Test that the returned comment does not contain each license.
  • If it does, return a string like "Rejected: License." Ie it's not a comment.
@ksandom ksandom added the enhancement New feature or request label Jan 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant