mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2025-12-13 02:20:38 +08:00
precommit: Add pre-commit hook to check copyright in ros2 files
This commit is contained in:
committed by
Peter Barker
parent
ce6dc895fb
commit
128e46aa48
3
.github/workflows/pre-commit.yml
vendored
3
.github/workflows/pre-commit.yml
vendored
@@ -12,3 +12,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: 3.x
|
python-version: 3.x
|
||||||
- uses: pre-commit/action@v3.0.1
|
- uses: pre-commit/action@v3.0.1
|
||||||
|
- run: python3 -m pip install --upgrade pip
|
||||||
|
- run: python3 -m pip install pytest
|
||||||
|
- run: PYTHONPATH="." pytest tests/test_pre_commit_copyright.py
|
||||||
|
|||||||
@@ -78,6 +78,22 @@ repos:
|
|||||||
additional_dependencies:
|
additional_dependencies:
|
||||||
- tomli
|
- tomli
|
||||||
|
|
||||||
|
- repo: local
|
||||||
|
hooks:
|
||||||
|
- id: check-copyright
|
||||||
|
name: check copyright notice in files
|
||||||
|
entry: Tools/gittools/pre_commit_copyright.py
|
||||||
|
language: python
|
||||||
|
files: |
|
||||||
|
(?x)^(
|
||||||
|
Tools/ros2/.*\.py
|
||||||
|
)$
|
||||||
|
args: [
|
||||||
|
--ignore=Tools/ros2/ardupilot_dds_tests/setup.py,
|
||||||
|
--ignore=Tools/ros2/ardupilot_dds_tests/test/test_pep257.py,
|
||||||
|
--ignore=Tools/ros2/ardupilot_dds_tests/test/test_copyright.py,
|
||||||
|
]
|
||||||
|
|
||||||
# # Use to sort python imports by name and put system import first.
|
# # Use to sort python imports by name and put system import first.
|
||||||
# - repo: https://github.com/pycqa/isort
|
# - repo: https://github.com/pycqa/isort
|
||||||
# rev: 5.12.0
|
# rev: 5.12.0
|
||||||
|
|||||||
Reference in New Issue
Block a user