Commit 37da6c38 authored by deck's avatar deck

update readme file and add prettier-apply command

parent b3b3281b
......@@ -14,11 +14,14 @@ static:
image: ${GITLAB_CI_IMAGE_PYTHON}
before_script:
- pip install "$GITLAB_CI_PYPI_TOX"
- apt update
- apt install npm -y
- npm install -g prettier
script:
- tox -e "flake8,isort,yapf,pylint,prettier"
- tox -e "flake8,isort,yapf,pylint"
static_js_css:
stage: static
image: ${GITLAB_CI_IMAGE_NODE}
script:
- npm install -g prettier
- prettier --check "./polaris/**/*.html"
build:
stage: build
image: ${GITLAB_CI_IMAGE_PYTHON}
......
......@@ -120,17 +120,25 @@ It is important to format the code before commiting, otherwise the
CI engine will fail. We have a tox command setup to run tests before
committing so you will never have to push failing pipelines. Code
linting is also done to ensure the code does not have any errors
before committing:
before committing.
First you will have to install prettier :
```bash
$ npm install -g prettier
```
You can learn more about npm [here](https://www.npmjs.com/).
```bash
# Install tox to execute CI tasks
$ (.venv) pip install tox
# Auto-format the code
$ (.venv) tox -e yapf-apply -e isort-apply
$ (.venv) tox -e yapf-apply -e isort-apply -e prettier-apply
______________________ summary______________________
yapf-apply: commands succeeded
isort: commands succeeded
prettier-apply: commands succeeded
congratulations :)
# Verify CI test passes
......@@ -143,6 +151,7 @@ ______________________ summary______________________
pylint: commands succeeded
build: commands succeeded
pytest: commands succeeded
prettier: commands succeeded
congratulations :)
```
......
[tox]
envlist = flake8,isort,yapf,pylint,build,pytest, prettier
envlist = flake8,isort,yapf,pylint,build,pytest,prettier
[depversions]
flake8 = 3.7.7
......@@ -27,6 +27,11 @@ deps =
skip_install = True
commands = yapf -d -r .
[testenv:prettier-apply]
whitelist_externals = prettier
skip_install = True
commands = prettier --write "./polaris/**/*.html"
[testenv:prettier]
skip_install = True
commands = prettier --check "./polaris/**/*.html"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment