forked from Field-Robotics-Lab/dave
-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (65 loc) · 2.2 KB
/
lint.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
72
73
74
75
76
77
78
---
name: Code Formatting Lint
# yamllint disable-line rule:truthy
on:
push:
tags: ["*"]
branches:
- ros2
jobs:
# ament_lint:
# runs-on: ubuntu-latest
# container:
# image: rostooling/setup-ros-docker:ubuntu-noble-ros-jazzy-desktop-latest
# options: -u root
# strategy:
# fail-fast: false
# matrix:
# linter: [flake8, mypy, pep8, xmllint]
# steps:
# - uses: actions/checkout@v2
# - uses: ros-tooling/action-ros-lint@master
# with:
# linter: ${{ matrix.linter }}
# package-name: .
run-linters:
name: Run Linters for Code Format Check
runs-on: ubuntu-24.04
steps:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Set up Python 3.12
uses: actions/setup-python@v1
with:
python-version: 3.12
- name: Install Python dependencies
run: pip install black flake8 cmakelang
- name: Install ClangFormat
run: sudo apt-get install -y clang-format
- name: Run Linters for python and C++
uses: wearerequired/lint-action@v2
with:
black: true
black_args: --line-length 100
flake8: true
flake8_args: --max-line-length=100
clang_format: true
- name: Install XML Linting tools
run: sudo apt-get install -y libxml2-utils
- name: Run XML Linter for URDF, SDF, Xacro, XML files
run: |
find . \( -iname '*.urdf' -o -iname '*.sdf' -o -iname '*.xacro' \
-o -iname '*.xml' -o -iname '*.launch' -o -iname '*.world' \) -print0 | xargs -0 xmllint --noout
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
- name: Run Yamllint on YAML and .launch files
run: |
find . \( -iname '*.yml' -o -iname '*.yaml' \) -print0 | xargs -0 yamllint -d "{
extends: default,
rules: {
line-length: {max: 120},
new-line-at-end-of-file: disable
}
}"
- name: Lint CMake files
run: find . \( -iname 'CMakeLists.txt' -o -iname '*.cmake' \) -print0 | xargs -0 cmake-lint