From b1581ffc43734d8ac241ddcf35ce93733a2022ff Mon Sep 17 00:00:00 2001 From: David Yackzan Date: Thu, 9 Nov 2023 08:01:05 -0500 Subject: [PATCH] Add files for format CI workflow --- .github/workflows/format.yaml | 17 ++++++++ .pre-commit-config.yaml | 77 +++++++++++++++++++++++++++++++++ markdown-link-check-config.json | 1 + 3 files changed, 95 insertions(+) create mode 100644 .github/workflows/format.yaml create mode 100644 .pre-commit-config.yaml create mode 100644 markdown-link-check-config.json diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml new file mode 100644 index 0000000..07ca0b9 --- /dev/null +++ b/.github/workflows/format.yaml @@ -0,0 +1,17 @@ +name: Format + +on: + workflow_dispatch: + pull_request: + push: + branches: + - ros2 + +jobs: + pre-commit: + name: pre-commit + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..549b36b --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,77 @@ +# To use: +# +# pre-commit run -a +# +# Or: +# +# pre-commit install # (runs every time you commit in git) +# +# To update this file: +# +# pre-commit autoupdate +# +# See https://github.com/pre-commit/pre-commit +repos: + # Standard hooks + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.4.0 + hooks: + - id: check-ast + - id: check-case-conflict + - id: check-docstring-first + - id: check-merge-conflict + - id: check-symlinks + - id: check-yaml + args: ["--unsafe"] # Fixes errors parsing custom YAML constructors like ur_description's !degrees + exclude: 'src/moveit_studio_web/pnpm-lock.yaml' + - id: debug-statements + - id: end-of-file-fixer + - id: mixed-line-ending + - id: fix-byte-order-marker + + - repo: https://github.com/psf/black + rev: 22.3.0 + hooks: + - id: black + + - repo: https://github.com/codespell-project/codespell + rev: v2.0.0 + hooks: + - id: codespell + args: ["--write-changes", "-L", "atleast,inout,ether"] # Provide a comma-separated list of misspelled words that codespell should ignore (for example: '-L', 'word1,word2,word3'). + exclude: (\.(svg|pyc|stl|dae|asc)|pnpm-lock.yaml)$ + + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: v14.0.6 + hooks: + - id: clang-format + files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|m|proto|vert)$ + # -i arg is included by default by the hook + args: ["-fallback-style=none"] + + - repo: https://github.com/adrienverge/yamllint + rev: v1.27.1 + hooks: + - id: yamllint + args: + [ + "--no-warnings", + "--config-data", + "{extends: default, rules: {line-length: disable, braces: {max-spaces-inside: 1}}}", + ] + types: [text] + files: \.(yml|yaml)$ + exclude: 'src/moveit_studio_web/pnpm-lock.yaml' + + - repo: https://github.com/tcort/markdown-link-check + rev: v3.10.3 + hooks: + - id: markdown-link-check + args: + - "-c" + - "markdown-link-check-config.json" + + - repo: https://github.com/hadolint/hadolint + rev: v2.12.0 + hooks: + - id: hadolint-docker diff --git a/markdown-link-check-config.json b/markdown-link-check-config.json new file mode 100644 index 0000000..1bd58aa --- /dev/null +++ b/markdown-link-check-config.json @@ -0,0 +1 @@ +{"ignorePatterns": [{"pattern": "^https://docs.google.com"}]}