From 12efafb8f82a2aa43c6bf5a6f1c5a1824e559c6b Mon Sep 17 00:00:00 2001 From: alexjmpb Date: Fri, 26 Aug 2022 16:28:15 -0500 Subject: [PATCH] feat: adding github action to run linting automatically --- .github/workflows/push.yml | 13 +++++++++++++ Makefile | 5 +++++ stylelint.config.js | 4 ++++ 3 files changed, 22 insertions(+) create mode 100644 .github/workflows/push.yml create mode 100644 stylelint.config.js diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 00000000..0ea551c9 --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,13 @@ +name: Test +on: [push] + +jobs: + linters: + name: stylelint + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Run stylelint + run: + make run_linter \ No newline at end of file diff --git a/Makefile b/Makefile index 3d90ef16..83afc576 100644 --- a/Makefile +++ b/Makefile @@ -29,3 +29,8 @@ update_translations: ## update strings to be translated compile_translations: ## compile .mo files into .po files pybabel compile -f -D django -d $(theme)/conf/locale/; \ pybabel compile -f -D djangojs -d $(theme)/conf/locale/ + + +run_linter: + npm install --save-dev stylelint @edx/stylelint-config-edx + npx stylelint "**/*.scss" \ No newline at end of file diff --git a/stylelint.config.js b/stylelint.config.js new file mode 100644 index 00000000..833dbc15 --- /dev/null +++ b/stylelint.config.js @@ -0,0 +1,4 @@ +module.exports = { + extends: '@edx/stylelint-config-edx' + }; + \ No newline at end of file