2015-07-19 03:18:49 +00:00
|
|
|
[tox]
|
2018-03-28 08:46:44 +00:00
|
|
|
minversion=2.9.0
|
2017-06-01 19:07:51 +00:00
|
|
|
envlist = py{27,36},lint,docs
|
2015-07-19 03:18:49 +00:00
|
|
|
skipsdist = True
|
|
|
|
|
2017-06-14 22:51:00 +00:00
|
|
|
[travis]
|
|
|
|
python =
|
|
|
|
2.7: py27
|
2018-09-05 14:45:26 +00:00
|
|
|
3.6: py36, coverage
|
2017-06-14 16:38:03 +00:00
|
|
|
|
2015-07-19 03:18:49 +00:00
|
|
|
[testenv]
|
2018-03-28 08:46:44 +00:00
|
|
|
description = run test suite for the application with {basepython}
|
2015-07-19 03:18:49 +00:00
|
|
|
setenv =
|
|
|
|
PYTHONPATH={toxinidir}/readthedocs:{toxinidir}
|
2018-02-22 14:49:50 +00:00
|
|
|
DJANGO_SETTINGS_MODULE=readthedocs.settings.test
|
2015-07-20 08:07:40 +00:00
|
|
|
LANG=C
|
2018-05-16 21:48:26 +00:00
|
|
|
LC_CTYPE=C.UTF-8
|
2018-09-28 16:59:33 +00:00
|
|
|
DJANGO_SETTINGS_SKIP_LOCAL=True
|
2017-05-24 20:46:40 +00:00
|
|
|
deps = -r{toxinidir}/requirements/testing.txt
|
2015-07-19 03:18:49 +00:00
|
|
|
changedir = {toxinidir}/readthedocs
|
|
|
|
commands =
|
2018-09-05 14:45:26 +00:00
|
|
|
py.test --cov-report= --cov-config {toxinidir}/.coveragerc --cov=. {posargs}
|
2015-07-19 07:03:55 +00:00
|
|
|
|
|
|
|
[testenv:docs]
|
2018-03-28 08:46:44 +00:00
|
|
|
description = build readthedocs documentation
|
2015-07-19 07:03:55 +00:00
|
|
|
changedir = {toxinidir}/docs
|
|
|
|
commands =
|
2018-05-30 18:53:51 +00:00
|
|
|
sphinx-build -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
|
2015-07-19 03:18:49 +00:00
|
|
|
|
2018-02-21 17:27:10 +00:00
|
|
|
[testenv:docs-lint]
|
2018-05-23 04:27:42 +00:00
|
|
|
description = run linter (rstcheck) to ensure there aren't errors on our docs
|
2018-02-21 18:24:40 +00:00
|
|
|
deps = -r{toxinidir}/requirements/docs-lint.txt
|
2018-02-21 17:27:10 +00:00
|
|
|
changedir = {toxinidir}/docs
|
|
|
|
commands =
|
2018-02-24 23:17:03 +00:00
|
|
|
rstcheck -r .
|
2018-02-21 17:27:10 +00:00
|
|
|
|
2015-07-19 03:18:49 +00:00
|
|
|
[testenv:lint]
|
2018-03-28 08:46:44 +00:00
|
|
|
description = run linter (prospector) to ensure the source code corresponds to our coding standards
|
2016-07-18 18:31:37 +00:00
|
|
|
deps = -r{toxinidir}/requirements/lint.txt
|
2015-07-19 03:18:49 +00:00
|
|
|
commands =
|
2017-03-21 18:39:00 +00:00
|
|
|
prospector \
|
|
|
|
--profile-path={toxinidir} \
|
|
|
|
--profile=prospector-more \
|
2017-06-14 16:38:03 +00:00
|
|
|
--die-on-tool-error {posargs}
|
2015-07-19 03:18:49 +00:00
|
|
|
prospector \
|
|
|
|
--profile-path={toxinidir} \
|
|
|
|
--profile=prospector \
|
2017-06-14 16:38:03 +00:00
|
|
|
--die-on-tool-error {posargs}
|
2017-05-23 18:17:48 +00:00
|
|
|
|
Add eslint using the airbnb config. (#2905)
* Add eslint using the airbnb config.
In an effort to make the JS consistent, this adds an ESLint gulp task. ESLint
is *very* configurable, and has no defaults. Instead, this reaches for
airbnb's legacy config (which covers ES5), which is one of the most popular
configurations. As a last step, it turns off all of the rules which currently
fail. We can turn them on piecemeal, or override the airbnb style to use a
different format.
Rules to prioritize (as they likely indicate bugs):
* "array-callback-return": "off",
* "eqeqeq": "off",
* "guard-for-in": "off",
* "no-inner-declarations": "off",
* "no-loop-func": "off",
* "no-mixed-operators": "off",
* "no-undef": "off",
* "no-use-before-define": "off",
* "one-var": "off",
* Lint frontend in Travis.
This adds an ESLint step to the CI service so we prevent unlinted code from
making its way in.
* Create an ESLint tox env.
By adding a tox env for eslint, we allow users to run it locally as part of
tox runs.
Thanks for the suggestion @ericholscher!
* Fix tox call to gulp lint task
2017-05-24 23:12:33 +00:00
|
|
|
[testenv:eslint]
|
2018-07-05 15:52:33 +00:00
|
|
|
description = run the JavaScript linter (requires `npm install`)
|
Add eslint using the airbnb config. (#2905)
* Add eslint using the airbnb config.
In an effort to make the JS consistent, this adds an ESLint gulp task. ESLint
is *very* configurable, and has no defaults. Instead, this reaches for
airbnb's legacy config (which covers ES5), which is one of the most popular
configurations. As a last step, it turns off all of the rules which currently
fail. We can turn them on piecemeal, or override the airbnb style to use a
different format.
Rules to prioritize (as they likely indicate bugs):
* "array-callback-return": "off",
* "eqeqeq": "off",
* "guard-for-in": "off",
* "no-inner-declarations": "off",
* "no-loop-func": "off",
* "no-mixed-operators": "off",
* "no-undef": "off",
* "no-use-before-define": "off",
* "one-var": "off",
* Lint frontend in Travis.
This adds an ESLint step to the CI service so we prevent unlinted code from
making its way in.
* Create an ESLint tox env.
By adding a tox env for eslint, we allow users to run it locally as part of
tox runs.
Thanks for the suggestion @ericholscher!
* Fix tox call to gulp lint task
2017-05-24 23:12:33 +00:00
|
|
|
commands =
|
2018-07-05 15:52:33 +00:00
|
|
|
npm run lint
|
2017-05-23 18:17:48 +00:00
|
|
|
|
|
|
|
[testenv:coverage]
|
2018-03-28 08:46:44 +00:00
|
|
|
description = run test suite with code coverage for the application with {basepython}
|
2018-09-05 14:45:26 +00:00
|
|
|
deps = coverage
|
2017-05-23 18:17:48 +00:00
|
|
|
whitelist_externals = echo
|
|
|
|
commands =
|
2018-09-05 16:04:05 +00:00
|
|
|
coverage report --show-missing --fail-under=76
|
2017-05-23 18:17:48 +00:00
|
|
|
echo Annotated HTML coverage report is in {toxinidir}/readthedocs/htmlcov/index.html
|