Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/slicPublic

Speedy LIcense Checker and associated tools

License

NotificationsYou must be signed in to change notification settings

gerv/slic

Repository files navigation

This is slic, the Speedy LIcense Checker. It scans a codebase and identifiesthe license of each file. It can also optionally extract the license textand a list of copyright holders - this is very useful for meeting theobligations of licenses which require reproduction of license text. It outputsdata in a JSON structure (by default) which can then be further processed byother tools.It runs at about 120 files per second on a single core of a 3GHz Intel I7(it's CPU-bound, at least on a machine with an SSD). So you can do 100,000files in less than 15 minutes. Parallel invocation is left as an exercise forthe reader, but could easily be bolted on the side by dividing up the inputs.You can extend slic to identify new licenses or tweak the detection of existingones by adding to a regexp-containing structure in the license_data.py file.There is a test suite which makes sure it continues to correctly detect thelicenses it already knows about. This uses the "nose" testing framework -simply run "nosetests" to run the test suite. You can add files to the slicdetection test suite easily using the add_test_case script.One additional tool is flic, which stands for Format LICenses. This takesthe output of slic, processes it, and passes the result to a Jinja2 template.Again, this is very useful for generating an "Open Source Licenses" page orfile to meet obligations about reproducing the text of licenses. Running slic-------------Use slic --help for help.To try it out on data which ships with slic:./slic -D --plain test/data/identificationRun slic over a codebase and generate JSON output:cd /usr/src/mycodebase/path/to/slic . > occurrences.jsonOr, if your needs are more complex:* Put a list of all the files and paths you want to scan in "slic-paths.txt"* Create a file in the slic directory called "mycodebase.ini" with any  codebase-specific config (see b2g/b2g.ini for inspiration)  cd /usr/src/mycodebase/path/to/slic --config=mycodebase.ini < slic-paths.txt > occurrences.jsonRunning flic------------Requires the existence of an output file generated by slic./path/to/flic --input occurrences.json --template license.html > out.htmlThe template needs to be in the $FLIC_DIR/flic_templates directory.

About

Speedy LIcense Checker and associated tools

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp