Code Monkey home page Code Monkey logo

Comments (4)

wxy avatar wxy commented on September 20, 2024

在运行 grank all 命令时,不需要指定仓库名或组织名,会读取该配置中列出的仓库或组织。

from grank.

bestony avatar bestony commented on September 20, 2024

配置文件形态

{
	"config": {
		"start": "123-12-2",
		"end": "123-12-1",
		"token": "xxx",
		"top": 3,
                 "star":123
	},
	"targets": [
		{
			"socialRule": "xxx",
			"owner": "lctt",
			"repository": "grank"
		},{
			"socialRule": "xxx",
			"owner": "lctt",
			"repository": "lcbot"
		}
	]
}

from grank.

bestony avatar bestony commented on September 20, 2024

实现思路

  1. 创建一个新的命令(all 或 batch),新的命令接受一个文件作为参数(可以考虑传入文件或文件路径,即 File arguments 或 File Path arguments,相关文档http://click.palletsprojects.com/en/7.x/arguments/#file-arguments)
  2. 解析 JSON,提取 JSON 中的 config 来生成 config 实例。
  3. 对 targets 进行循环,循环时修改 config 实例中的 social.rule 为targets 中具体的。
  4. targets 中均为 repo ,调用 repo 分析代码即可。

from grank.

suncle1993 avatar suncle1993 commented on September 20, 2024

建议python代码直接使用py文件作为配置文件,其他都需要处理一些路径问题。(配置和代码一起走,不同环境用不同的py,配置的选择使用不同环境的环境变量,默认为localhost)

from grank.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.