From 6d604dd4bfcb6031ba63692f5a66ba2550f50d69 Mon Sep 17 00:00:00 2001 From: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com> Date: Wed, 15 Dec 2021 10:01:03 +0900 Subject: [PATCH] ci: add yamllint (#182) * ci: add yamllint Signed-off-by: Kenji Miyake * style: apply yamllint Signed-off-by: Kenji Miyake --- .clang-format | 11 +++---- .github/dependabot.yml | 6 ++-- .../workflows/build-and-test-scheduled.yaml | 2 +- .github/workflows/delete-closed-pr-docs.yaml | 2 +- .github/workflows/deploy-docs.yaml | 2 +- .pre-commit-config.yaml | 32 +++++++++++-------- .yamllint.yaml | 12 +++++++ mkdocs.yaml | 19 +++++++---- .../config/elevation_map_parameters.yaml | 2 +- 9 files changed, 55 insertions(+), 33 deletions(-) create mode 100644 .yamllint.yaml diff --git a/.clang-format b/.clang-format index 88623d36ddbcb..7762ec9dfb800 100644 --- a/.clang-format +++ b/.clang-format @@ -1,4 +1,3 @@ ---- # Modified from https://github.com/ament/ament_lint/blob/master/ament_clang_format/ament_clang_format/configuration/.clang-format Language: Cpp BasedOnStyle: Google @@ -19,23 +18,23 @@ PointerAlignment: Middle ReflowComments: true IncludeCategories: # C++ system headers - - Regex: "<[a-z_]*>" + - Regex: <[a-z_]*> Priority: 6 CaseSensitive: true # C system headers - - Regex: '<.*\.h>' + - Regex: <.*\.h> Priority: 5 CaseSensitive: true # Boost headers - - Regex: "boost/.*" + - Regex: boost/.* Priority: 4 CaseSensitive: true # Message headers - - Regex: ".*_msgs/.*" + - Regex: .*_msgs/.* Priority: 3 CaseSensitive: true # Other Package headers - - Regex: "<.*>" + - Regex: <.*> Priority: 2 CaseSensitive: true # Local package headers diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b940a74a4c60b..9a2fbd7542dad 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,7 @@ version: 2 updates: - - package-ecosystem: "github-actions" - directory: "/" + - package-ecosystem: github-actions + directory: / schedule: - interval: "daily" + interval: daily open-pull-requests-limit: 1 diff --git a/.github/workflows/build-and-test-scheduled.yaml b/.github/workflows/build-and-test-scheduled.yaml index 9f5231feb42e1..60f275ef5c005 100644 --- a/.github/workflows/build-and-test-scheduled.yaml +++ b/.github/workflows/build-and-test-scheduled.yaml @@ -2,7 +2,7 @@ name: build-and-test-scheduled on: schedule: - - cron: "0 19 * * *" # run at 4 AM JST + - cron: 0 19 * * * # run at 4 AM JST workflow_dispatch: jobs: diff --git a/.github/workflows/delete-closed-pr-docs.yaml b/.github/workflows/delete-closed-pr-docs.yaml index 103009c646ed9..de35277ed184d 100644 --- a/.github/workflows/delete-closed-pr-docs.yaml +++ b/.github/workflows/delete-closed-pr-docs.yaml @@ -2,7 +2,7 @@ name: delete-closed-pr-docs on: schedule: - - cron: "0 19 * * *" # run at 4 AM JST + - cron: 0 19 * * * # run at 4 AM JST workflow_dispatch: jobs: diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml index 437e264679633..3a4fc976f75fd 100644 --- a/.github/workflows/deploy-docs.yaml +++ b/.github/workflows/deploy-docs.yaml @@ -6,7 +6,7 @@ on: - main - tier4/proposal paths: - - "mkdocs.yaml" + - mkdocs.yaml - "**/*.md" - "**/*.svg" - "**/*.png" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dca1deff13c37..7e8233e8aeae2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,13 +21,19 @@ repos: rev: v0.30.0 hooks: - id: markdownlint - args: ["-c", ".markdownlint.yaml", "--fix"] + args: [-c, .markdownlint.yaml, --fix] - repo: https://github.com/pre-commit/mirrors-prettier rev: v2.5.0 hooks: - id: prettier + - repo: https://github.com/adrienverge/yamllint + rev: v1.26.3 + hooks: + - id: yamllint + exclude: .*.param.yaml + - repo: https://github.com/tier4/pre-commit-hooks-ros rev: v0.4.0 hooks: @@ -54,7 +60,7 @@ repos: rev: 21.11b1 hooks: - id: black - args: ["--line-length=100"] + args: [--line-length=100] - repo: https://github.com/PyCQA/flake8 rev: 4.0.1 @@ -62,14 +68,14 @@ repos: - id: flake8 additional_dependencies: [ - "flake8-blind-except", - "flake8-builtins", - "flake8-class-newline", - "flake8-comprehensions", - "flake8-deprecated", - "flake8-docstrings", - "flake8-import-order", - "flake8-quotes", + flake8-blind-except, + flake8-builtins, + flake8-class-newline, + flake8-comprehensions, + flake8-deprecated, + flake8-docstrings, + flake8-import-order, + flake8-quotes, ] - repo: https://github.com/pre-commit/mirrors-clang-format @@ -81,7 +87,7 @@ repos: rev: 1.5.5 hooks: - id: cpplint - args: ["--quiet"] - exclude: ".cu" + args: [--quiet] + exclude: .cu -exclude: ".svg|control/trajectory_follower|control/trajectory_follower_nodes|common/autoware_auto_dependencies|common/autoware_auto_perception_rviz_plugin|common/osqp_interface|simulator/simple_planning_simulator|planning/freespace_planner|planning/astar_search|planning/costmap_generator" +exclude: .svg|control/trajectory_follower|control/trajectory_follower_nodes|common/autoware_auto_dependencies|common/autoware_auto_perception_rviz_plugin|common/osqp_interface|simulator/simple_planning_simulator|planning/freespace_planner|planning/astar_search|planning/costmap_generator diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 0000000000000..271510322aab9 --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,12 @@ +extends: default + +rules: + comments: + min-spaces-from-content: 1 # To be compatible with C++ and Python + document-start: + present: false # Don't need document start markers + line-length: disable # Delegate to Prettier + truthy: + allowed-values: ["true", "false", "on"] # https://github.com/adrienverge/yamllint/issues/158#issuecomment-536735525 + quoted-strings: + required: only-when-needed # To keep consistent style diff --git a/mkdocs.yaml b/mkdocs.yaml index 4495be26b402b..a5e536c87b589 100644 --- a/mkdocs.yaml +++ b/mkdocs.yaml @@ -3,7 +3,7 @@ site_url: https://autowarefoundation.github.io/autoware.universe repo_url: https://github.com/autowarefoundation/autoware.universe edit_uri: edit/main/ docs_dir: . -copyright: "Copyright © 2021 The Autoware Foundation" +copyright: Copyright © 2021 The Autoware Foundation theme: name: material @@ -50,22 +50,27 @@ plugins: - awesome-pages - exclude: regex: - - '^(?!(.*/)?assets/).*\.(?!(.*\.)?md|(.*\.)?svg|(.*\.)?png|(.*\.)?jpg).*$' - - "^(.*/)?[^.]*$" + - ^(?!(.*/)?assets/).*\.(?!(.*\.)?md|(.*\.)?svg|(.*\.)?png|(.*\.)?jpg).*$ + - ^(.*/)?[^.]*$ - same-dir - search markdown_extensions: - admonition - attr_list - - codehilite: { guess_lang: false } + - codehilite: + guess_lang: false - fontawesome_markdown - footnotes - mdx_math - - mdx_truly_sane_lists: { nested_indent: 2 } + - mdx_truly_sane_lists: + nested_indent: 2 - mdx_unimoji - - plantuml_markdown: { server: "http://www.plantuml.com/plantuml", format: svg } + - plantuml_markdown: + server: http://www.plantuml.com/plantuml + format: svg - pymdownx.arithmatex - pymdownx.highlight - pymdownx.superfences - - toc: { permalink: "#" } + - toc: + permalink: "#" diff --git a/perception/elevation_map_loader/config/elevation_map_parameters.yaml b/perception/elevation_map_loader/config/elevation_map_parameters.yaml index 955a9e197ea0b..781ccb806b25d 100644 --- a/perception/elevation_map_loader/config/elevation_map_parameters.yaml +++ b/perception/elevation_map_loader/config/elevation_map_parameters.yaml @@ -5,7 +5,7 @@ pcl_grid_map_extraction: x: 0.0 y: 0.0 z: 0.0 - rotation: #intrinsic rotation X-Y-Z (r-p-y)sequence + rotation: # intrinsic rotation X-Y-Z (r-p-y)sequence r: 0.0 p: 0.0 y: 0.0