Skip to content

Commit

Permalink
add linting ci job
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippvK committed Feb 15, 2024
1 parent baab2c4 commit 6046795
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Lint

on: [push, pull_request]

jobs:
run-linters:
name: Run linters
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install Python dependencies
run: pip install black flake8

- name: Run linters
uses: wearerequired/lint-action@v1
with:
black: true
black_args: "--line-length=120"
flake8: true
flake8_args: "--max-line-length=120 --ignore=E203,W503"

check-license:
name: Check for License headers
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v3

- name: Install Python dependencies
run: pip install licenseheaders

- name: Download template file
run: wget https://raw.githubusercontent.com/johann-petrak/licenseheaders/master/templates/apache-2.tmpl

- name: Run check
run: |
licenseheaders -t apache-2.tmpl -y "${YEARS}" -o "${OWNER}" -n "${PROJECT}" -u "${URL}" -d . -E "${EXTENSIONS}"
test -z "$(git status --untracked-files=no --porcelain)" || (echo "Please check your license headers!" ; git status --untracked-files=no --porcelain ; false) && echo "License check was successful."
env:
OWNER: "TUM Department of Electrical and Computer Engineering"
PROJECT: "Seal5"
YEARS: "2024"
URL: "https://github.com/tum-ei-eda/mlonmcu.git"
EXTENSIONS: "py c cpp"
EXCLUDE: ".venv models"

0 comments on commit 6046795

Please sign in to comment.