architv / harvey Goto Github PK
View Code? Open in Web Editor NEW:information_desk_person: Harvey is a command line legal expert who manages license for your open source project.
License: MIT License
:information_desk_person: Harvey is a command line legal expert who manages license for your open source project.
License: MIT License
Check your chosen license against the licenses of libraries you create. Can your package be MIT if you depend on a GPL-2 library? etc.
Less of a bug and more of a tip.
By default, most of app works well on Windows (Windows 10 over here) except for colorama. ANSI escape sequences show up in terminal instead of color.
I fixed this by building https://github.com/adoxa/ansicon from source and installing. Works great now.
sys.exit(1)
and prints the error message to stderr
harvey
it is simply so hard to handle the No such license...
errorharvey doesn't work under python3 and python2 is nearing EOL
❯ harvey MIT > LICENSE 666ms
Traceback (most recent call last):
File "/usr/local/bin/harvey", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python3.6/site-packages/harvey/harvey.py", line 163, in main
print(_get_license_description(arguments['<NAME>'].lower()))
File "/usr/local/lib/python3.6/site-packages/harvey/harvey.py", line 81, in _get_license_description
name=_get_config_name())
File "/usr/local/lib/python3.6/site-packages/harvey/harvey.py", line 58, in _get_config_name
return _stripslashes(output[0])
File "/usr/local/lib/python3.6/site-packages/harvey/harvey.py", line 48, in _stripslashes
r = re.sub(r"\\(n|r)", "\n", s)
File "/usr/local/Cellar/python/3.6.4_3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/re.py", line 191, in sub
return _compile(pattern, flags).sub(repl, string, count)
TypeError: cannot use a string pattern on a bytes-like object
I get the following result when I run harvery mit
:
Traceback (most recent call last):
File "/usr/local/bin/harvey", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/site-packages/harvey/harvey.py", line 163, in main
print(_get_license_description(arguments['<NAME>'].lower()))
File "/usr/local/lib/python2.7/site-packages/harvey/harvey.py", line 86, in _get_license_description
license = re.sub(r'\[(.+)\]', replace_string, s)
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 155, in sub
return _compile(pattern, flags).sub(repl, string, count)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 16: ordinal not in range(128)
The reason is the character ć
in my name. Would be nice if harvey
was able to handle unicode characters.
$ python harvey/harvey.py list
{license_name} [{license_code}]
Traceback (most recent call last):
File "harvey/harvey.py", line 152, in
main()
File "harvey/harvey.py", line 142, in main
_get_licences()
File "harvey/harvey.py", line 64, in _get_licences
print("{license_name} [{license_code}]").format(license_name=licenses[license], license_code=license)
AttributeError: 'NoneType' object has no attribute 'format'
Fix:
print("{license_name} [{license_code}]".format(license_name=licenses[license], license_code=license))
Ironically, what harvey does is a copyright violation of the GNU licenses.
Copyright (C) 2007 Free Software Foundation, Inc. http://fsf.org/
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
And at the end (for me):
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.Copyright (C) 2015 Benjamin Mintz
Obviously, I'm not going to go around telling people to put my name on their software.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.