learning-bot

所属分类:Git
开发工具:GO
文件大小:0KB
下载次数:0
上传日期:2020-03-25 11:10:00
上 传 者sh-1993
说明:  一个GitLab机器人程序,用于从代码修复工具提供编程建议。
(A GitLab bot for providing programming advice from code repair tools.)

文件列表:
CHANGELOG.md (568, 2020-03-25)
LICENSE (34523, 2020-03-25)
Makefile (191, 2020-03-25)
assets/ (0, 2020-03-25)
assets/checkstyle-lb.xml (9641, 2020-03-25)
cmd/ (0, 2020-03-25)
cmd/config.go (5329, 2020-03-25)
cmd/manage.go (3715, 2020-03-25)
cmd/start.go (2206, 2020-03-25)
go.mod (758, 2020-03-25)
go.sum (10296, 2020-03-25)
main.go (488, 2020-03-25)
models/ (0, 2020-03-25)
models/models.go (1894, 2020-03-25)
models/report.go (2625, 2020-03-25)
models/repository.go (1675, 2020-03-25)
models/repository_test.go (1010, 2020-03-25)
modules/ (0, 2020-03-25)
modules/checkstyle/ (0, 2020-03-25)
modules/checkstyle/checks.go (14783, 2020-03-25)
modules/checkstyle/checkstyle.go (4434, 2020-03-25)
modules/checkstyle/checkstyle_test.go (972, 2020-03-25)
modules/cron/ (0, 2020-03-25)
modules/cron/cron.go (11017, 2020-03-25)
modules/settings/ (0, 2020-03-25)
modules/settings/config.go (6397, 2020-03-25)
modules/settings/gitlab.go (667, 2020-03-25)
modules/settings/projects.go (2028, 2020-03-25)
modules/utils/ (0, 2020-03-25)
modules/utils/system_check.go (514, 2020-03-25)
modules/utils/utils.go (670, 2020-03-25)
modules/utils/utils_test.go (719, 2020-03-25)
project_services_gitlab/ (0, 2020-03-25)
project_services_gitlab/learning_bot_service.rb (1537, 2020-03-25)
public/ (0, 2020-03-25)
public/css/ (0, 2020-03-25)
... ...

# Learning bot ## Purpose The aim of this project is to create a GitLab bot which would download students code and generate a report containing advice on repairing issues found in the source code. ### Plan Currently, the plan is to use [checkstyle] to list issues in the code, which is parsed by this program, detecting which type of error it is and on which line and file. Then an issue will be created on the project's issue tracker with a link to the report. The report would contain a list of all the issues in the source code, each of which would give a preview of the code and a suggestion on how to fix it. Alternatively, a CI-based add-on would be built into GitLab which would add a badge to each commit, which would redirect to the report page. ## Requirements The following packages must be installed on your system. - git - Go *(tested with 1.12)* - GNU make - OpenJDK Runtime Environment *(tested with 1.8.0)* - unzip *(Unix utility)* - checkstyle *(jar, tested with 8.22)* The program supports MySQL, but it is optional requirement as an SQLite option is available. No additional packages are needed to be installed for database functionality. ## Installation from source ### Downloading ``` $ git clone https://github.com/peergramming/learning-bot.git $ cd learning-bot $ make clean all ``` **Note:** You have to run the binary in the directory, so the program is able to find web files required to render the web pages. ### Configuring Before running the web server, the program has to be configured using the `config` command-line option. ``` $ ./learning-bot config ``` The program will guide you through the process on creating a new configuration file. You'll have to specify the SQL driver/server, checkstyle jar and configuration location, bot private token, and so on... Once configured, the program would generate a `config.toml` file (which can be later edited, if required). #### Adding projects to check The bot will not check any projects by default, but it can be added using the interactive `manage` tool. This can be automated with scripts by using the add and remove subcommands: ``` $ learning-bot manage [add/remove] [project] ``` The project consists of the user and project name separated with a slash, such as `humaid/dsa-cw-1`. The projects list is stored in the `active-projects.toml` file. ### Running the bot The bot can be run using the following command, this would also start a web server to display reports (unless if you start it with `--no-web`). ``` $ ./learning-bot run ``` By default, the bot would automatically check all active repositories at start, and it would repeat on interval as configured. ## Further configuration There are some default configuration values which aren't setup in the wizard. Here is the documentation for `config.toml`. - `site_title`: Title of the website and bot. - `site_url`: The URL of the bot website, including port, used in issue tracker link. - `bot_private_access_token`: Bot account's private access token. - `checkstyle_jar_path`: Path for the checkstyle JAR file, must be downloaded separately. - `checkstyle_config_path`: Path for the checkstyle configuration file, provided by the project. - `gitlab_instance_url`: The URL of the GitLab instance for the API, links and integration. - `gitlab_skip_verify_check`: Skip verification with authenticating with GitLab API via HTTPS. - `lms_title`: Optional LMS link title. - `lms_url`: Optional LMS link URL. - `check_active_repositories_cron`: Cron job schedule interval. Learn more about format [here](https://godoc.org/github.com/robfig/cron#hdr-Predefined_schedules). - `timezone`: Timezone used for report and database. - `code_snippet_include_previous_lines`: Maximum number of lines to include before troubled line in report code snippet. - `database`: Database configuration field. - `type`: Driver type; 0 for SQLite, 1 for MySQL. - `host`: [MySQL] The host of the MySQL server. - `name`: [MySQL] The name of the MySQL user. - `ssl_mode`: [MySQL] The SSL/TLS mode of the MySQL connection. - `path`: [SQLite] The path for the SQLite database file. - `limits`: Limitations configuration field. - `max_check_workers`: Maximum number of concurrent workers checking repositories. - `max_issues_per_report`: Maximum number of issues per report (-1 for no limit). - `max_issues_per_type_per_report`: Maximum number of issues per type in a report (-1 for no limit). [checkstyle]: https://checkstyle.org/

近期下载者

相关文件


收藏者