给github和gitlab上面的工程评分, 基于criticality_score,增加了批量统计的功能
设置GitHub Token:
- 如果你还没有Token,创建一个Github Token
,设置环境变量
GITHUB_AUTH_TOKEN
. 这样可以避免Github的api用量限制
export GITHUB_AUTH_TOKEN=<your access token>
如果你统计的项目里有GitLab的项目,还需要设置GitLab的Token:
- 如果你还没有,创建一个Gitlab Token
,设置环境变量
GITLAB_AUTH_TOKEN
.
准备工程的url列表文件,一行一个url, 格式可以参考本项目的projects.txt文件
git clone https://github.com/kunpengcompute/reposcore
cd reposcore
python3 setup.py install或pip install -e .
通过python3 setup.py install
的方式安装完成后,会生成demo配置文件/etc/reposcore/reposcore.conf
。
通过pip install -e .
方式安装的话,需要手动把本项目etc
目录的reposcore.conf
demo文件拷贝到/etc/reposcore/reposcore.conf
中。
然后执行命令
reposcore --project-list projects_url_file --result-file result.csv
最终输出为csv格式的文件
Score github or gitlab's projects, based on criticality_score, added batch function.
Before running, you need to setup Access Token
to overcome the rate-limit of API calling:
For GitHub repos, you need to create a GitHub access token and set it in environment variable GITHUB_AUTH_TOKEN
.
export GITHUB_AUTH_TOKEN=<your access token>
For GitLab repos, you need to create a GitLab access token and set it in environment variable GITLAB_AUTH_TOKEN
.
Prepare a projects url file, one url per line, please refer to projects.txt
git clone https://github.com/kunpengcompute/reposcore
cd reposcore
python3 setup.py install or pip install -e .
If installed with python3 setup.py install
command,there will be a demo configuration file: /etc/reposcore/reposcore.conf
。
If installed with pip install -e .
command, you will have to copy the reposcore.conf
demon configuration file under /etc/
to /etc/reposcore/reposcore.conf
Finally, run:
reposcore --project-list projects_url_file --result-file result.csv
The output file is in csv format.