-
Notifications
You must be signed in to change notification settings - Fork 9
71 lines (58 loc) · 2.11 KB
/
linter.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Lint Code Base
# run on pull requests and for main commits (thus also merges)
on:
pull_request:
push:
branches:
- main
- 'release/*'
# group by branch and cancel existing jobs on new pushes for same group
concurrency:
group: linters-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint Code Base
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
##########################
# Checkout the code base #
##########################
- name: Check out code
uses: actions/checkout@v4
with:
# Full git history is needed within `super-linter`
fetch-depth: 0
################################
# Run Linter against code base #
################################
- name: Lint Code Base
# Linter action from github market place
# (slim tag has less tools, but still all the ones for python)
uses: docker://ghcr.io/github/super-linter:slim-v4.9.2
# These determines the linters versions executed remotely,
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Path to where config files are
LINTER_RULES_PATH: ./
# Super linter not following correctly exclusions
# FILTER_REGEX_EXCLUDE: (.*/xxx/.*|yyy/.*|)
PYTHON_BLACK_CONFIG_FILE: pyproject.toml
# Flake8 does not support pyproject.toml ATM
# https://github.com/PyCQA/flake8/issues/234
PYTHON_FLAKE8_CONFIG_FILE: .flake8
PYTHON_ISORT_CONFIG_FILE: pyproject.toml
MARKDOWN_CONFIG_FILE: .markdownlint.yaml
####################################
# Only runs on files changed since last execution
VALIDATE_ALL_CODEBASE: false
# Also if conflicts are presents, github prevents execution
####################################
VALIDATE_PYTHON_BLACK: true
VALIDATE_PYTHON_FLAKE8: true
VALIDATE_PYTHON_ISORT: true
# VALIDATE_PYTHON_MYPY: true
# VALIDATE_PYTHON_PYLINT: true
VALIDATE_MARKDOWN: true