Commit f5a3df2c authored by Maxime Emschwiller's avatar Maxime Emschwiller
Browse files

feat(ci): run prettier in ci

parent 6fd21383
Pipeline #62968 failed with stages
in 2 minutes and 20 seconds
...@@ -58,7 +58,7 @@ lint_backend: ...@@ -58,7 +58,7 @@ lint_backend:
tags: tags:
- docker - docker
lint_frontend: lint_frontend_and_documentation:
<<: *only-default <<: *only-default
stage: check_and_lint stage: check_and_lint
image: registry.gitlab.utc.fr/rex-dri/rex-dri/frontend:v2.1.0 image: registry.gitlab.utc.fr/rex-dri/rex-dri/frontend:v2.1.0
...@@ -66,10 +66,10 @@ lint_frontend: ...@@ -66,10 +66,10 @@ lint_frontend:
- cd frontend && mkdir -p node_modules && mv -f /usr/src/deps/node_modules/* /usr/src/deps/node_modules/.bin ./node_modules/ - cd frontend && mkdir -p node_modules && mv -f /usr/src/deps/node_modules/* /usr/src/deps/node_modules/.bin ./node_modules/
script: script:
- yarn lint - yarn lint
- yarn lint-doc
tags: tags:
- docker - docker
test_back: test_back:
<<: *only-default <<: *only-default
stage: test stage: test
......
...@@ -27,6 +27,12 @@ docker-pull: ...@@ -27,6 +27,12 @@ docker-pull:
reformat_backend: reformat_backend:
docker-compose exec backend sh -c "cd backend && black ." docker-compose exec backend sh -c "cd backend && black ."
reformat_frontend:
docker-compose exec frontend sh -c "cd frontend && yarn reformat"
reformat_documentation:
docker-compose exec frontend sh -c "cd frontend && yarn reformat-doc"
test_backend: test_backend:
docker-compose exec backend sh -c "cd backend && pytest --cov --cov-config .coveragerc --cov-report term base_app/ backend_app/ stats_app/" docker-compose exec backend sh -c "cd backend && pytest --cov --cov-config .coveragerc --cov-report term base_app/ backend_app/ stats_app/"
...@@ -42,6 +48,9 @@ lint_backend: ...@@ -42,6 +48,9 @@ lint_backend:
lint_frontend: lint_frontend:
docker-compose exec frontend sh -c "cd frontend && yarn lint" docker-compose exec frontend sh -c "cd frontend && yarn lint"
lint_documentation:
docker-compose exec frontend sh -c "cd frontend && yarn lint-doc"
build_frontend: build_frontend:
docker-compose exec frontend sh -c "cd frontend && yarn build" docker-compose exec frontend sh -c "cd frontend && yarn build"
......
/webpack-stats.json
...@@ -4,8 +4,11 @@ ...@@ -4,8 +4,11 @@
"description": "[![build](/../badges/master/build.svg)](https://gitlab.utc.fr/chehabfl/outgoing_rex/pipelines) [![coverage](/../badges/master/coverage.svg)](https://chehabfl.gitlab.utc.fr/outgoing_rex/) [![License](https://img.shields.io/badge/License-BSD%202--Clause-green.svg)](https://opensource.org/licenses/BSD-2-Clause)", "description": "[![build](/../badges/master/build.svg)](https://gitlab.utc.fr/chehabfl/outgoing_rex/pipelines) [![coverage](/../badges/master/coverage.svg)](https://chehabfl.gitlab.utc.fr/outgoing_rex/) [![License](https://img.shields.io/badge/License-BSD%202--Clause-green.svg)](https://opensource.org/licenses/BSD-2-Clause)",
"main": "manage.py", "main": "manage.py",
"scripts": { "scripts": {
"lint": "eslint src --ext js --ext jsx", "lint": "prettier --check . && eslint src --ext js --ext jsx",
"reformat": "prettier --write .",
"lint-fix": "eslint src --ext js --ext jsx --fix", "lint-fix": "eslint src --ext js --ext jsx --fix",
"lint-doc": "prettier --check ../documentation",
"reformat-doc": "prettier --write ../documentation",
"dev": "node server.js", "dev": "node server.js",
"build": "webpack --config webpack.config.build.js", "build": "webpack --config webpack.config.build.js",
"test": "jest", "test": "jest",
......
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