mirror of https://github.com/zulip/zulip.git
lint: Check for long lines in all markdown files in general.
This has a few excludes for cases involving code blocks where it would have been difficult to clean up.
This commit is contained in:
parent
9289c75f54
commit
8b839c96d4
|
@ -111,7 +111,9 @@ git](https://github.com/zulip/tsearch_extras).
|
||||||
|
|
||||||
Now continue with the [All Systems](#all-systems) instructions below.
|
Now continue with the [All Systems](#all-systems) instructions below.
|
||||||
|
|
||||||
#### Using the [official Zulip PPA](https://launchpad.net/~tabbott/+archive/ubuntu/zulip/+packages) (for 14.04 Trusty or 16.04 Xenial):
|
#### Using the [official Zulip PPA][zulip-ppa] (for 14.04 Trusty or 16.04 Xenial):
|
||||||
|
|
||||||
|
[zulip-ppa]: https://launchpad.net/~tabbott/+archive/ubuntu/zulip/+packages
|
||||||
|
|
||||||
Start by cloning this repository: `git clone
|
Start by cloning this repository: `git clone
|
||||||
https://github.com/zulip/zulip.git`
|
https://github.com/zulip/zulip.git`
|
||||||
|
|
|
@ -102,7 +102,9 @@ Create the migration file: `./manage.py makemigrations`. Make sure to
|
||||||
commit the generated file to git: `git add zerver/migrations/NNNN_realm_invite_by_admins_only.py`
|
commit the generated file to git: `git add zerver/migrations/NNNN_realm_invite_by_admins_only.py`
|
||||||
(NNNN is a number that is equal to the number of migrations.)
|
(NNNN is a number that is equal to the number of migrations.)
|
||||||
|
|
||||||
If you run into problems, the [Django migration documentation](https://docs.djangoproject.com/en/1.8/topics/migrations/) is helpful.
|
If you run into problems, the
|
||||||
|
[Django migration documentation](https://docs.djangoproject.com/en/1.8/topics/migrations/)
|
||||||
|
is helpful.
|
||||||
|
|
||||||
### Test your migration changes
|
### Test your migration changes
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,8 @@ won't find any information there. pg_ctlcluster runs the following
|
||||||
command underneath when it actually goes to start Postgres:
|
command underneath when it actually goes to start Postgres:
|
||||||
|
|
||||||
```
|
```
|
||||||
/usr/lib/postgresql/9.1/bin/pg_ctl start -D /var/lib/postgresql/9.1/main -s -o '-c config_file="/etc/postgresql/9.1/main/postgresql.conf"'
|
/usr/lib/postgresql/9.1/bin/pg_ctl start -D /var/lib/postgresql/9.1/main -s -o \
|
||||||
|
'-c config_file="/etc/postgresql/9.1/main/postgresql.conf"'
|
||||||
```
|
```
|
||||||
|
|
||||||
Since pg_ctl doesn't redirect stdout or stderr, running the above can
|
Since pg_ctl doesn't redirect stdout or stderr, running the above can
|
||||||
|
|
|
@ -77,7 +77,8 @@ the end of 2016.
|
||||||
"reactions"](https://github.com/zulip/zulip/issues/541)
|
"reactions"](https://github.com/zulip/zulip/issues/541)
|
||||||
* [Open graph previews of generic
|
* [Open graph previews of generic
|
||||||
websites](https://github.com/zulip/zulip/issues/406)
|
websites](https://github.com/zulip/zulip/issues/406)
|
||||||
* [Add a "join Zulip chat" badge for projects that use Zulip to document that nicely](https://github.com/zulip/zulip/issues/2270)
|
* [Add a "join Zulip chat" badge for projects that use Zulip to
|
||||||
|
document that nicely](https://github.com/zulip/zulip/issues/2270)
|
||||||
|
|
||||||
## Real-time sync
|
## Real-time sync
|
||||||
|
|
||||||
|
@ -217,8 +218,10 @@ process and make bots that receive messages just as easy to build.
|
||||||
|
|
||||||
* [Add an outgoing webhook integration system](https://github.com/zulip/zulip/issues/735)
|
* [Add an outgoing webhook integration system](https://github.com/zulip/zulip/issues/735)
|
||||||
* [Make setting up a new integration a smooth flow](https://github.com/zulip/zulip/issues/692)
|
* [Make setting up a new integration a smooth flow](https://github.com/zulip/zulip/issues/692)
|
||||||
* [Default new incoming webhooks to permissions-limited incoming webhook bots](https://github.com/zulip/zulip/issues/2186)
|
* [Default new incoming webhooks to permissions-limited incoming webhook
|
||||||
* [Change how Zulip displays bot names to distinguish them from human users](https://github.com/zulip/zulip/issues/1107)
|
bots](https://github.com/zulip/zulip/issues/2186)
|
||||||
|
* [Change how Zulip displays bot names to distinguish them from human
|
||||||
|
users](https://github.com/zulip/zulip/issues/1107)
|
||||||
|
|
||||||
## Android app
|
## Android app
|
||||||
|
|
||||||
|
|
|
@ -87,8 +87,8 @@ redirects the browser to a login page. This is used in the root path
|
||||||
(`/`) of the website for the web client. If a request comes from a
|
(`/`) of the website for the web client. If a request comes from a
|
||||||
browser without a valid session cookie, they are redirected to a login
|
browser without a valid session cookie, they are redirected to a login
|
||||||
page. It is a small fork of Django's
|
page. It is a small fork of Django's
|
||||||
[login_required](https://docs.djangoproject.com/en/1.8/topics/auth/default/#django.contrib.auth.decorators.login_required),
|
[login_required][login-required-link], adding a few extra checks
|
||||||
adding a few extra checks specific to Zulip.
|
specific to Zulip.
|
||||||
|
|
||||||
```py
|
```py
|
||||||
@zulip_login_required
|
@zulip_login_required
|
||||||
|
@ -96,6 +96,8 @@ def home(request):
|
||||||
# type: (HttpRequest) -> HttpResponse
|
# type: (HttpRequest) -> HttpResponse
|
||||||
```
|
```
|
||||||
|
|
||||||
|
[login-required-link]: https://docs.djangoproject.com/en/1.8/topics/auth/default/#django.contrib.auth.decorators.login_required
|
||||||
|
|
||||||
### Writing a template
|
### Writing a template
|
||||||
|
|
||||||
Templates for the main website are found in
|
Templates for the main website are found in
|
||||||
|
@ -109,7 +111,8 @@ request bodies, and return JSON-string responses. Almost all Zulip
|
||||||
view code is in the implementations of API REST endpoints.
|
view code is in the implementations of API REST endpoints.
|
||||||
|
|
||||||
The REST API does authentication of the user through `rest_dispatch`,
|
The REST API does authentication of the user through `rest_dispatch`,
|
||||||
which is documented in detail at [zerver/lib/rest.py](https://github.com/zulip/zulip/blob/master/zerver/lib/rest.py).
|
which is documented in detail at
|
||||||
|
[zerver/lib/rest.py](https://github.com/zulip/zulip/blob/master/zerver/lib/rest.py).
|
||||||
This method will authenticate the user either through a session token
|
This method will authenticate the user either through a session token
|
||||||
from a cookie on the browser, or from a base64 encoded `email:api-key`
|
from a cookie on the browser, or from a base64 encoded `email:api-key`
|
||||||
string given via HTTP Basic Auth for API clients.
|
string given via HTTP Basic Auth for API clients.
|
||||||
|
|
|
@ -159,6 +159,7 @@ def build_custom_checkers(by_lang):
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
if (max_length is not None and len(line) > max_length and
|
if (max_length is not None and len(line) > max_length and
|
||||||
'# type' not in line and 'test' not in fn and 'example' not in fn and
|
'# type' not in line and 'test' not in fn and 'example' not in fn and
|
||||||
|
not re.match("\[[a-z0-9_-]*\]: http.*", line) and
|
||||||
"#ignorelongline" not in line and 'migrations' not in fn):
|
"#ignorelongline" not in line and 'migrations' not in fn):
|
||||||
print("Line too long (%s) at %s line %s: %s" % (len(line), fn, i+1, line_newline_stripped))
|
print("Line too long (%s) at %s line %s: %s" % (len(line), fn, i+1, line_newline_stripped))
|
||||||
lastLine = line
|
lastLine = line
|
||||||
|
@ -435,9 +436,20 @@ def build_custom_checkers(by_lang):
|
||||||
if custom_check_file(fn, json_rules):
|
if custom_check_file(fn, json_rules):
|
||||||
failed = True
|
failed = True
|
||||||
|
|
||||||
|
markdown_docs_length_exclude = {
|
||||||
|
"contrib_bots/lib/ConverterBot/docs.md",
|
||||||
|
"docs/bots-guide.md",
|
||||||
|
"docs/dev-env-first-time-contributors.md",
|
||||||
|
"docs/integration-guide.md",
|
||||||
|
"docs/life-of-a-request.md",
|
||||||
|
"docs/logging.md",
|
||||||
|
"docs/migration-renumbering.md",
|
||||||
|
"docs/readme-symlink.md",
|
||||||
|
"README.md",
|
||||||
|
}
|
||||||
for fn in by_lang['md']:
|
for fn in by_lang['md']:
|
||||||
max_length = None
|
max_length = None
|
||||||
if '/help/' in fn:
|
if fn not in markdown_docs_length_exclude:
|
||||||
max_length = 120
|
max_length = 120
|
||||||
if custom_check_file(fn, markdown_rules, max_length=max_length):
|
if custom_check_file(fn, markdown_rules, max_length=max_length):
|
||||||
failed = True
|
failed = True
|
||||||
|
|
Loading…
Reference in New Issue