|
19 | 19 | """ |
20 | 20 | CycloneDX related helpers and utils. |
21 | 21 | """ |
22 | | - |
| 22 | +from urllib.parse import urlparse |
23 | 23 | from collections.abc import Iterable |
24 | 24 | from re import compile as re_compile |
25 | 25 | from typing import Any, Optional |
@@ -134,12 +134,52 @@ def licenses_fixup(component: 'Component') -> None: |
134 | 134 | 'docs': ExternalReferenceType.DOCUMENTATION, |
135 | 135 | 'changelog': ExternalReferenceType.RELEASE_NOTES, |
136 | 136 | 'changes': ExternalReferenceType.RELEASE_NOTES, |
| 137 | + 'releasenotes': ExternalReferenceType.RELEASE_NOTES, |
| 138 | + 'news': ExternalReferenceType.RELEASE_NOTES, |
| 139 | + 'whatsnew': ExternalReferenceType.RELEASE_NOTES, |
| 140 | + 'history': ExternalReferenceType.RELEASE_NOTES, |
137 | 141 | # 'source': ExternalReferenceType.SOURCE-DISTRIBUTION, |
138 | 142 | 'repository': ExternalReferenceType.VCS, |
139 | 143 | 'github': ExternalReferenceType.VCS, |
140 | 144 | 'chat': ExternalReferenceType.CHAT, |
| 145 | + 'sponsor': ExternalReferenceType.SOCIAL, |
| 146 | + 'donation': ExternalReferenceType.SOCIAL, |
| 147 | + 'donate': ExternalReferenceType.SOCIAL |
| 148 | +} |
| 149 | +URL_MAP = { |
| 150 | + # Hosting |
| 151 | + "github.com": ExternalReferenceType.VCS, |
| 152 | + "gitlab.com": ExternalReferenceType.VCS, |
| 153 | + "bitbucket.org": ExternalReferenceType.VCS, |
| 154 | + # Social |
| 155 | + "discord.gg": ExternalReferenceType.SOCIAL, |
| 156 | + "discord.com": ExternalReferenceType.SOCIAL, |
| 157 | + "discordapp.com": ExternalReferenceType.SOCIAL, |
| 158 | + "glitter.im": ExternalReferenceType.SOCIAL, |
| 159 | + "mastodon.com": ExternalReferenceType.SOCIAL, |
| 160 | + "reddit.com": ExternalReferenceType.SOCIAL, |
| 161 | + "slack.com": ExternalReferenceType.SOCIAL, |
| 162 | + "youtube.com": ExternalReferenceType.SOCIAL, |
| 163 | + "youtu.be": ExternalReferenceType.SOCIAL, |
| 164 | + "twitter.com": ExternalReferenceType.SOCIAL, |
| 165 | + "x.com": ExternalReferenceType.SOCIAL, |
| 166 | + # Docs |
| 167 | + "readthedocs.io": ExternalReferenceType.DOCUMENTATION, |
| 168 | + # CI |
| 169 | + "ci.appveyor.com": ExternalReferenceType.QUALITY_METRICS, |
| 170 | + "circleci.com": ExternalReferenceType.QUALITY_METRICS, |
| 171 | + "codecov.io":ExternalReferenceType.QUALITY_METRICS, |
| 172 | + "coveralls.io": ExternalReferenceType.QUALITY_METRICS, |
| 173 | + "travis-ci.com": ExternalReferenceType.QUALITY_METRICS, |
| 174 | + "travis-ci.org": ExternalReferenceType.QUALITY_METRICS, |
| 175 | + # PyPI |
| 176 | + "cheeseshop.python.org": ExternalReferenceType.DISTRIBUTION, |
| 177 | + "pypi.io": ExternalReferenceType.DISTRIBUTION, |
| 178 | + "pypi.org": ExternalReferenceType.DISTRIBUTION, |
| 179 | + "pypi.python.org": ExternalReferenceType.DISTRIBUTION, |
| 180 | + # Python |
| 181 | + "python.org": ExternalReferenceType.WEBSITE, |
141 | 182 | } |
142 | | - |
143 | 183 | _NOCHAR_MATCHER = re_compile('[^a-z]') |
144 | 184 |
|
145 | 185 |
|
|
0 commit comments