Skip to content

Commit

Permalink
Add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
erikbosch committed Mar 8, 2024
1 parent 301eb3f commit fb12739
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 7 deletions.
8 changes: 1 addition & 7 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
[flake8]
max-line-length = 120
exclude =
.git,
__pycache__,
.venv,
# Ignore generated *_pb2.py files
gen_proto, *_pb2*
max_line_length = 120
34 changes: 34 additions & 0 deletions .github/workflows/check_license.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: spdx

on:
pull_request

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}

Check failure on line 7 in .github/workflows/check_license.yml

View workflow job for this annotation

GitHub Actions / MegaLinter

7:7 [indentation] wrong indentation: expected 2 but found 6
cancel-in-progress: true

jobs:
check-spdx-headers:
runs-on: ubuntu-latest

steps:

- name: Checkout code

Check failure on line 16 in .github/workflows/check_license.yml

View workflow job for this annotation

GitHub Actions / MegaLinter

16:5 [indentation] wrong indentation: expected 6 but found 4
uses: actions/checkout@v4
with:
# required to grab the history of the PR
fetch-depth: 0
submodules: 'true'

- name: Get changed files
run: |
echo "files=$(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} | tr '\n' ',')" >> $GITHUB_ENV
- name: Set license
run: |
echo "licenses=Apache-2.0" >> $GITHUB_ENV
- uses: eclipse-kuksa/kuksa-actions/spdx@2
with:
files: "${{ env.files }}"
licenses: "${{ env.licenses }}"
24 changes: 24 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: pre-commit

on: [pull_request]

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
pre-commit:

Check failure on line 10 in .github/workflows/pre-commit.yml

View workflow job for this annotation

GitHub Actions / MegaLinter

10:3 [indentation] wrong indentation: expected 6 but found 2
runs-on: ubuntu-latest

Check failure on line 11 in .github/workflows/pre-commit.yml

View workflow job for this annotation

GitHub Actions / MegaLinter

11:5 [indentation] wrong indentation: expected 8 but found 4

steps:
- uses: actions/checkout@v4

Check failure on line 14 in .github/workflows/pre-commit.yml

View workflow job for this annotation

GitHub Actions / MegaLinter

14:7 [indentation] wrong indentation: expected 10 but found 6
with:
# required to grab the history of the PR
fetch-depth: 0

Check failure on line 17 in .github/workflows/pre-commit.yml

View workflow job for this annotation

GitHub Actions / MegaLinter

17:11 [indentation] wrong indentation: expected 14 but found 10
submodules: 'true'
- uses: actions/setup-python@v5
with:
python-version: '3.10'

Check failure on line 21 in .github/workflows/pre-commit.yml

View workflow job for this annotation

GitHub Actions / MegaLinter

21:11 [indentation] wrong indentation: expected 14 but found 10
- uses: pre-commit/action@v3.0.1
with:
extra_args: --color=always --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}

Check failure on line 24 in .github/workflows/pre-commit.yml

View workflow job for this annotation

GitHub Actions / MegaLinter

24:11 [indentation] wrong indentation: expected 14 but found 10
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks

Check failure on line 4 in .pre-commit-config.yaml

View workflow job for this annotation

GitHub Actions / MegaLinter

4:4 [hyphens] too many spaces after hyphen
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude_types: ["dbc"]
- id: end-of-file-fixer
exclude_types: ["dbc", "json"]
exclude: \.token$
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/pycqa/flake8
rev: '7.0.0'
hooks:
- id: flake8

0 comments on commit fb12739

Please sign in to comment.