Skip to content

Commit

Permalink
ops: make lint possible on dev
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgarel committed Oct 8, 2021
1 parent 2370e21 commit 2ecd558
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ Get started running server in development mode, see [Dev environment quick start

## Contributions Best Practices

### Check before commiting

You can save you sometime by running some checks localy before commiting.

`make checks` should work.

### Commits

* Write clear meaningful git commit messages (Do read [here](https://chris.beams.io/posts/git-commit/)).
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@ import_prod_data:
${DOCKER_COMPOSE} exec -T mongodb /bin/sh -c "cd /data/db && tar -xzvf openfoodfacts-mongodbdump.tar.gz && mongorestore --batchSize=1 && rm openfoodfacts-mongodbdump.tar.gz"
rm openfoodfacts-mongodbdump.tar.gz

#--------#
# Checks #
#--------#

front_lint:
COMPOSE_FILE="docker-compose.yml;docker/dev.yml;docker/jslint.yml" docker-compose run --rm dynamicfront npm run lint

checks: front_lint

#------------#
# Production #
#------------#
Expand Down
15 changes: 15 additions & 0 deletions docker/jslint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: "3.7"

# Some tweaks to be able to run npm run lint
services:
dynamicfront:
command: ["npm", "run", "lint"]
volumes:
# linting conf
- ./.eslintrc.js:/opt/product-opener/.eslintrc.js
- ./.eslintignore:/opt/product-opener/.eslintignore
- ./.stylelintrc.json:/opt/product-opener/.stylelintrc.json
- ./.stylelintignore:/opt/product-opener/.stylelintignore
# extra files to lint
- ./scripts:/opt/product-opener/scripts
- ./test:/opt/product-opener/test

0 comments on commit 2ecd558

Please sign in to comment.