Skip to content

Commit

Permalink
Update pre-commit setup. (StoglRobotics#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
destogl authored Jan 11, 2023
1 parent 8550721 commit 9c81501
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 27 deletions.
36 changes: 13 additions & 23 deletions templates/package/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
repos:
# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-ast
Expand All @@ -29,50 +29,40 @@ repos:
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
exclude_types: [rst]
- id: fix-byte-order-marker


# Python hooks
- repo: https://github.com/asottile/pyupgrade
rev: v2.37.3
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py36-plus]

- repo: https://github.com/psf/black
rev: 22.6.0
hooks:
- id: black
args: ["--line-length=99"]

# PEP 257
- repo: https://github.com/FalconSocial/pre-commit-mirrors-pep257
rev: v0.3.3
# PyDocStyle
- repo: https://github.com/PyCQA/pydocstyle
rev: 6.2.2
hooks:
- id: pep257
- id: pydocstyle
args: ["--ignore=D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D404"]

- repo: https://github.com/pycqa/flake8
rev: 5.0.4
rev: 6.0.0
hooks:
- id: flake8
args: ["--ignore=E501"]
args: ["--extend-ignore=E501"]

# CPP hooks
- repo: local
hooks:
- id: clang-format
name: clang-format
description: Format files with ClangFormat.
entry: clang-format-12
entry: clang-format-14
language: system
files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|js|m|proto|vert)$
args: ['-fallback-style=none', '-i']
# The same options as in ament_cppcheck are used, but its not working...
#- repo: https://github.com/pocc/pre-commit-hooks
#rev: v1.1.1
#hooks:
#- id: cppcheck
#args: ['--error-exitcode=1', '-f', '--inline-suppr', '-q', '-rp', '--suppress=internalAstError', '--suppress=unknownMacro', '--verbose']

- repo: local
hooks:
Expand Down Expand Up @@ -119,7 +109,7 @@ repos:

# Docs - RestructuredText hooks
- repo: https://github.com/PyCQA/doc8
rev: v1.0.0
rev: v1.1.1
hooks:
- id: doc8
args: ['--max-line-length=100', '--ignore=D001']
Expand All @@ -136,7 +126,7 @@ repos:
# Spellcheck in comments and docs
# skipping of *.svg files is not working...
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
rev: v2.2.2
hooks:
- id: codespell
args: ['--ignore-words=.codespell-ignore-words.txt', '--write-changes']
Expand Down
8 changes: 4 additions & 4 deletions templates/package/CI-github_ci-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4.4.0
with:
python-version: 3.9.7
python-version: '3.10'
- name: Install system hooks
run: sudo apt install -qq clang-format-12 cppcheck
- uses: pre-commit/action@v2.0.3
run: sudo apt install -qq clang-format-14 cppcheck
- uses: pre-commit/action@v3.0.0
with:
extra_args: --all-files --hook-stage manual

0 comments on commit 9c81501

Please sign in to comment.