Spaces:
Running
Running
yuyay licenseHygiene: word-boundary match (disclosed != closed)
Browse filesSigned-off-by: Stephen P. Lutar Jr. <stephenlutar2@gmail.com>
serve.py
CHANGED
|
@@ -1876,7 +1876,9 @@ try:
|
|
| 1876 |
score = 0.97 # neutral-honest default
|
| 1877 |
why = "default (no declared score)"
|
| 1878 |
if name == "licenseHygiene":
|
| 1879 |
-
|
|
|
|
|
|
|
| 1880 |
if bad:
|
| 1881 |
score = 0.40
|
| 1882 |
why = "non-permissive license token(s): " + ", ".join(bad)
|
|
|
|
| 1876 |
score = 0.97 # neutral-honest default
|
| 1877 |
why = "default (no declared score)"
|
| 1878 |
if name == "licenseHygiene":
|
| 1879 |
+
import re as _yre
|
| 1880 |
+
# word-boundary match so 'disclosed' doesn't match 'closed'
|
| 1881 |
+
bad = [w for w in _YUYAY_BAD_LICENSES if _yre.search(r"\b"+_yre.escape(w)+r"\b", t)]
|
| 1882 |
if bad:
|
| 1883 |
score = 0.40
|
| 1884 |
why = "non-permissive license token(s): " + ", ".join(bad)
|