diff --git a/.clang-format b/.clang-format index 8340806..76da189 100644 --- a/.clang-format +++ b/.clang-format @@ -1,4 +1,3 @@ ---- BasedOnStyle: Chromium AccessModifierOffset: -1 AlignAfterOpenBracket: Align diff --git a/.github/issue_template/task-template.md b/.github/issue_template/task-template.md deleted file mode 100644 index 5db17f9..0000000 --- a/.github/issue_template/task-template.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -name: Task template -about: 'Use this template when defining a new task in an issue. Make sure to fill - out all the fields. ' -title: "[TASK]" -labels: '' -assignees: '' - ---- - -**Time estimate:** XX hours -**Deadline:** DD.MONTH - -**Description of task:** DESCRIPTION diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..f0a6ced --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,15 @@ +name: pre-commit + +on: + push: + branches: + - main + pull_request: + types: [ opened, synchronize, reopened, ready_for_review ] + workflow_dispatch: +jobs: + pre-commit: + uses: vortexntnu/vortex-ci/.github/workflows/reusable-pre-commit.yml@main + with: + ros_distro: 'humble' + config_path: '.pre-commit-config.yaml' diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml index 70779d4..765aa2c 100644 --- a/.github/workflows/semantic-release.yml +++ b/.github/workflows/semantic-release.yml @@ -5,5 +5,5 @@ on: branches: - main jobs: - call_reusable_workflow: + semantic-release: uses: vortexntnu/vortex-ci/.github/workflows/reusable-semantic-release.yml@main diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e1850c7..6609d6c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,7 +35,7 @@ repos: - id: requirements-txt-fixer # Python hooks - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.9.2 + rev: v0.11.4 hooks: - id: ruff-format - id: ruff @@ -70,16 +70,46 @@ repos: pass_filenames: true # C++ hooks - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v19.1.7 + rev: v20.1.0 hooks: - id: clang-format args: [--style=file] + - repo: local + hooks: + - id: ament_cppcheck + name: ament_cppcheck + description: Static code analysis of C/C++ files. + entry: env AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS=1 ament_cppcheck + language: system + files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$ + exclude: (^|/)(test|tests)/.* # exclude test dirs since ament_cppcheck misparses GTest macros and throws false syntax errors + - repo: local + hooks: + - id: ament_cpplint + name: ament_cpplint + description: Static code analysis of C/C++ files. + entry: ament_cpplint + language: system + files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$ + args: [ + "--linelength=120", + "--filter=-whitespace/newline,-legal/copyright,-build/include_order" # ignore build/include_order since it conflicts with .clang-format + ] + # CMake hooks + - repo: local + hooks: + - id: ament_lint_cmake + name: ament_lint_cmake + description: Check format of CMakeLists.txt files. + entry: ament_lint_cmake + language: system + files: CMakeLists\.txt$ # Spellcheck in comments and docs - repo: https://github.com/codespell-project/codespell - rev: v2.3.0 + rev: v2.4.1 hooks: - id: codespell - args: ['--write-changes', '--ignore-words-list=theses,fom'] + args: ['--write-changes', '--ignore-words-list=theses,fom,NED,ENU'] ci: autoupdate_schedule: quarterly diff --git a/README.md b/README.md index 8b13789..93c924e 100644 --- a/README.md +++ b/README.md @@ -1 +1,41 @@ +# Introduction +``` +TODO: Write a simple description / introduction to the repository +``` + +# Setup + +``` +TODO: Write a setup guide +``` + +## Using pre-commit + +This project uses [pre-commit](https://github.com/pre-commit/pre-commit) to manage automated checks. + +### Install pre-commit +```bash +pip install pre-commit +``` + +### Run all hooks manually +```bash +pre-commit run --all-files +``` + +### Install the git hook +This will make the checks run automatically every time you `git commit`: +```bash +pre-commit install +``` + +### Update pre-commit hooks +```bash +pre-commit autoupdate +``` + +## GitHub Actions CI +- This project uses GitHub Actions for CI. +- Workflows are located in [`.github/workflows`](.github/workflows/). +- For more information, see [vortex-ci](https://github.com/vortexntnu/vortex-ci).