mirror of https://github.com/lukechilds/lnbits.git
fiatjaf
4 years ago
4 changed files with 40 additions and 25 deletions
@ -1,25 +1,33 @@ |
|||||
name: Run Linters |
name: Linters |
||||
|
|
||||
on: [push, pull_request] |
on: |
||||
|
push: |
||||
|
branches: [ master ] |
||||
|
pull_request: |
||||
|
branches: [ master ] |
||||
|
|
||||
jobs: |
jobs: |
||||
mypy: |
black: |
||||
runs-on: ubuntu-latest |
runs-on: ubuntu-latest |
||||
steps: |
steps: |
||||
- name: Checkout |
- uses: actions/checkout@v2 |
||||
uses: actions/checkout@v1 |
- run: sudo apt-get install python3-venv |
||||
- name: Run MyPy python type checker |
- run: python3 -m venv venv |
||||
uses: jpetrucciani/mypy-check@master |
- run: ./venv/bin/pip install black |
||||
with: |
- run: make checkblack |
||||
path: 'lnbits' |
|
||||
|
|
||||
prettier: |
prettier: |
||||
runs-on: ubuntu-latest |
runs-on: ubuntu-latest |
||||
steps: |
steps: |
||||
- name: Checkout |
- uses: actions/checkout@v2 |
||||
uses: actions/checkout@v1 |
- run: npm install |
||||
- name: Check JS code formatting convention |
- run: make checkprettier |
||||
uses: creyD/prettier_action@v2.2 |
mypy: |
||||
with: |
runs-on: ubuntu-latest |
||||
dry: True |
steps: |
||||
prettier_options: --write lnbits/static/js/** lnbits/core/static/js/** lnbits/extensions/*/templates/** |
- uses: actions/checkout@v2 |
||||
|
- run: sudo apt-get install python3-venv |
||||
|
- run: sudo apt-get install libev-dev |
||||
|
- run: python3 -m venv venv |
||||
|
- run: ./venv/bin/pip install -r requirements.txt |
||||
|
- run: ./venv/bin/pip install mypy |
||||
|
- run: make mypy |
||||
|
@ -1,10 +1,20 @@ |
|||||
all: prettier mypy black |
all: format check |
||||
|
|
||||
|
format: prettier black |
||||
|
|
||||
|
check: mypy checkprettier checkblack |
||||
|
|
||||
prettier: $(shell find lnbits -name "*.js" -name ".html") |
prettier: $(shell find lnbits -name "*.js" -name ".html") |
||||
./node_modules/.bin/prettier --write lnbits/static/js/*.js lnbits/core/static/js/*.js lnbits/extensions/*/templates/*/*.html ./lnbits/core/templates/core/*.html lnbits/templates/*.html lnbits/extensions/*/static/js/*.js |
./node_modules/.bin/prettier --write lnbits/static/js/*.js lnbits/core/static/js/*.js lnbits/extensions/*/templates/*/*.html ./lnbits/core/templates/core/*.html lnbits/templates/*.html lnbits/extensions/*/static/js/*.js |
||||
|
|
||||
|
black: $(shell find lnbits -name "*.py") |
||||
|
./venv/bin/black --line-length 120 lnbits |
||||
|
|
||||
mypy: $(shell find lnbits -name "*.py") |
mypy: $(shell find lnbits -name "*.py") |
||||
mypy lnbits |
./venv/bin/mypy lnbits |
||||
|
|
||||
black: $(shell find lnbits -name "*.py") |
checkprettier: $(shell find lnbits -name "*.js" -name ".html") |
||||
black lnbits |
./node_modules/.bin/prettier --check lnbits/static/js/*.js lnbits/core/static/js/*.js lnbits/extensions/*/templates/*/*.html ./lnbits/core/templates/core/*.html lnbits/templates/*.html lnbits/extensions/*/static/js/*.js |
||||
|
|
||||
|
checkblack: $(shell find lnbits -name "*.py") |
||||
|
./venv/bin/black --check --line-length 120 lnbits |
||||
|
@ -1,8 +1,5 @@ |
|||||
{ |
{ |
||||
"devDependencies": { |
"devDependencies": { |
||||
"prettier": "^2.0.5" |
"prettier": "^2.0.5" |
||||
}, |
|
||||
"scripts": { |
|
||||
"lint": "prettier --write lnbits/static/js/** lnbits/core/static/js/** lnbits/extensions/*/templates/**" |
|
||||
} |
} |
||||
} |
} |
||||
|
Loading…
Reference in new issue