Skip to content

Commit

Permalink
yaml lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
woensug-choi committed Jun 28, 2024
1 parent 8bbf5b7 commit 7c8baba
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ on:
tags: ["*"]
branches:
- ros2
pull_request:
branches:
- ros2

jobs:
# ament_lint:
Expand Down Expand Up @@ -62,14 +59,20 @@ jobs:
- 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' \) -print0 | xargs -0 xmllint --noout
-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: relaxed, rules: {new-line-at-end-of-file: {present: false}}}"
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
30 changes: 18 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ repos:
- id: trailing-whitespace
exclude_types: [rst]
- id: fix-byte-order-marker
- id: check-yaml
- id: destroyed-symlinks
- id: detect-private-key
- id: requirements-txt-fixer
Expand Down Expand Up @@ -173,14 +172,21 @@ repos:
- "--overwrite"
files: '\.(xacro|urdf|sdf|xml|launch|world)$'

# Not using dockerfile lint for now
# - repo: https://github.com/pryorda/dockerfilelint-precommit-hooks
# rev: v0.1.0
# hooks:
# - id: dockerfilelint
# files: \.dockerfile
# - repo: https://github.com/hadolint/hadolint
# rev: v2.12.0 # Use the revision rev you want to point at
# hooks:
# - id: hadolint
# files: \*.dockerfile
# Yaml lint
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
name: yamllint
description: This hook runs yamllint.
entry: >
yamllint -d "{
extends: default,
rules: {
line-length: {max: 120},
new-line-at-end-of-file: disable
}
}"
language: python
types: [file, yaml]
files: '\.(yaml|yml)$'

0 comments on commit 7c8baba

Please sign in to comment.