mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Add linting pipes
Also tweaked docker-build naming.
This commit is contained in:
parent
0ed7fa0ae9
commit
e1e362cc6a
6
.github/workflows/docker-build.yml
vendored
6
.github/workflows/docker-build.yml
vendored
@ -1,6 +1,8 @@
|
||||
name: Build Multi Arch Docker Images
|
||||
# yamllint disable rule:line-length
|
||||
---
|
||||
name: Build Docker Images
|
||||
|
||||
on:
|
||||
on: # yamllint disable-line rule:truthy
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
37
.github/workflows/lint.yml
vendored
Normal file
37
.github/workflows/lint.yml
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
# yamllint disable rule:line-length
|
||||
---
|
||||
name: Lint
|
||||
|
||||
on: [push, pull_request] # yamllint disable-line rule:truthy
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: "3.9"
|
||||
cache: "pip"
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install pylint black yamllint
|
||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
|
||||
- name: Run pylint
|
||||
run: |
|
||||
pylint --output-format=text $(find -type f -name "*.py" ! -path "**/.venv/**" ! -path "**/app/migrations/**") | tee /tmp/pylint.txt
|
||||
echo "pylint score: $(cat /tmp/pylint.txt | grep -oP 'Your code has been rated at \K[0-9]*\.?[0-9]*')"
|
||||
|
||||
- name: Run black
|
||||
run: black --check --diff .
|
||||
|
||||
- name: Lint YAML files
|
||||
run: yamllint .
|
Loading…
Reference in New Issue
Block a user