forked from markstory/lint-review
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsettings.py
113 lines (86 loc) · 3.61 KB
/
settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import os
def env(key, default, cast=str):
return cast(os.environ.get(key, default))
# Webserver configuration
#########################
# gunicorn config
# bind = env('LINTREVIEW_GUNICORN_BIND', '0.0.0.0:')
port = env('PORT', '5000')
# bind += port
# errorlog = env('LINTREVIEW_GUNICORN_LOG_ERROR',
# 'lintreview.error.log')
# accesslog = env('LINTREVIEW_GUNICORN_LOG_ACCESS',
# 'lintreview.access.log')
# debug = env('LINTREVIEW_GUNICORN_DEBUG', True, bool)
# loglevel = env('LINTREVIEW_GUNICORN_LOGLEVEL', 'debug')
# Basic flask config
DEBUG = env('LINTREVIEW_FLASK_DEBUG', False, bool)
TESTING = env('LINTREVIEW_TESTING', False, bool)
SERVER_NAME = env('LINTREVIEW_SERVER_NAME', '0.0.0.0:%s' % port)
# Config file for logging
LOGGING_CONFIG = './logging.ini'
# Celery worker configuration
#############################
from kombu import Exchange, Queue
# AMQP or other celery broker URL.
# amqp paths should be in the form of user:pass@host:port//virtualhost
BROKER_URL = 'amqp://'+''.join([
env('LINTREVIEW_MQ_USER', 'guest'), ':',
env('LINTREVIEW_MQ_PASS', 'guest'), '@',
env('LINTREVIEW_MQ_HOST',
env('BROKER_PORT_5672_TCP_ADDR', '127.0.0.1')), ':',
env('LINTREVIEW_MQ_PORT',
env('BROKER_PORT_5672_TCP_PORT', '5672')), '/',
env('LINTREVIEW_MQ_VIRTUAL_HOST', '/')
])
BROKER_URL = env('CLOUDAMQP_URL', '')
# Use json for serializing messages.
CELERY_TASK_SERIALIZER = 'json'
# Show dates and times in UTC
CELERY_ENABLE_UTC = True
# General project configuration
###############################
# Path where project code should be
# checked out when reviews are done
# Repos will be checked out into $WORKSPACE/$user/$repo/$number
# directories to prevent collisions.
WORKSPACE = env('LINTREVIEW_WORKSPACE', '/tmp/workspace')
# This config file contains default settings for .lintrc
# LINTRC_DEFAULTS = './lintrc_defaults.ini'
# Github Configuration
######################
# Use GITHUB_URL when working with github:e
GITHUB_URL = env('GITHUB_URL', 'https://api.github.com/')
# Github username + password
# This is the user that lintreview will use
# to fetch repositories and leave review comments.
# Set the GITHUB_PASSWORD environment variable first.
# example: $ export GITHUB_PASSWORD=mygithubpassword
GITHUB_USER = env('GITHUB_USERNAME', 'octocat')
GITHUB_PASSWORD = env('GITHUB_PASSWORD', '')
# You can also use an Oauth token for github, if you do
# uncomment this line. Using a token will take precedence
# over a username and password.
GITHUB_OAUTH_TOKEN = env('GITHUB_OAUTH_TOKEN', None)
# Set to a path containing a custom CA bundle.
# This is useful when you have github:enterprise on an internal
# network with self-signed certificates.
SSL_CA_BUNDLE = None
# After this many comments in a review, a single summary comment
# should be posted instead of individual line comments. This helps
# prevent really noisy reviews from slowing down github.
SUMMARY_THRESHOLD = env('LINTREVIEW_SUMMARY_THRESHOLD', 20, int)
# Status Configuration
######################
# Customize the build status integration name. Defaults to lintreview.
# APP_NAME = 'lintreview'
# Uncomment this option to enable adding an issue comment
# whenever a pull request passes all checks.
OK_COMMENT = env('LINTREVIEW_OK_COMMENT',
':+1: No lint errors found.')
# Enable to apply a label when updating build status.
# Pull requests that fail will have the label removed.
# Customize the label name when label statuses are enabled.
# OK_LABEL = env('LINTREVIEW_OK_LABEL', 'No lint errors')
CELERY_TASK_SERIALIZER = 'pickle'
CELERY_ACCEPT_CONTENT = ['pickle', 'json', 'msgpack', 'yaml']