Skip to content

Commit

Permalink
FEATURE: Add the configuration for git hooks
Browse files Browse the repository at this point in the history
Implementation of the basic configuration for the Python based multi-language supporting git hooks manager 'pre-commit' (https://pre-commit.com, https://github.com/pre-commit/pre-commit) by using hooks (actions, rules) from the common repository 'https://github.com/pre-commit/pre-commit-hooks' maintained by the very same organization.

This will make sure that the most common and generic programming mistakes and formatting issues will no longer be present in the Machinekit-HAL repository (but it is still a bit Python centric).

The Lefthook configuration file which was added by mistake as part of CMake rework was removed as it will not be used.
  • Loading branch information
cerna committed Feb 13, 2022
1 parent f282f05 commit 4433400
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 34 deletions.
59 changes: 59 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# ####################################################################
# Description: .pre-commit-config.yaml
#
# This file, '.pre-commit-config.yaml', implements
# the configuration rules for the Pre-Commit git hook manager
# for Machinekit-HAL project
#
# Copyright (C) 2022 Jakub Fišer <jakub DOT fiser AT eryaf DOT com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
# #####################################################################

exclude: ^attic/.*
default_stages:
- commit
- push
repos:
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
rev: v4.1.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-vcs-permalinks
- id: check-xml
- id: check-yaml
args:
- '--allow-multiple-documents'
- id: destroyed-symlinks
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: fix-encoding-pragma
args:
- '--remove'
- id: forbid-new-submodules
- id: no-commit-to-branch
args:
- '--branch'
- 'master'
- id: trailing-whitespace
34 changes: 0 additions & 34 deletions lefthook.yml

This file was deleted.

0 comments on commit 4433400

Please sign in to comment.