Git Product home page Git Product logo

capella-git-hooks's Introduction

Capella Git Hooks

image image

In this repository we provide git hooks, which can be useful when using git for storing Capella models. All hooks are designed to be included using the pre-commit framework. To include git a git hook from this repository, you have to add a .pre-commit-config.yaml file to the root of your repository. In this file you have to reference this repository to use hooks from here:

repos:
  - repo: https://github.com/DSD-DBS/capella-git-hooks.git
    rev: 862cf641c298f9666656b46b1bde3639c7592b01
    hooks:
      - id: ...

Available Hooks

In the following we will shortly summarize the available hooks and how to include them.

fix-links

This post-commit hook is a workaround, which checks all files for broken links starting with index:/. These can occur after using the merge tool as described in this issue. The general process looks as follows:

  1. Get all git tracked files not having uncommitted changes (as it is a post-commit hook, this includes changes committed in the triggering git command)
  2. Search and replace index:/ in all XML attributes - we ensure that the XML-structure does not change
  3. If files were changed, these are written to disk and committed in a separate commit using a predefined commit message ("fix[by-script]: merge tool index-prefix")

To use this hook add fix-links to the list of hooks in your .pre-commit-config.yaml.

repos:
  - repo: https://github.com/DSD-DBS/capella-git-hooks.git
    rev: 862cf641c298f9666656b46b1bde3639c7592b01
    hooks:
      - id: fix-links

Setting up a Development Environment

To set up a development environment, clone the project and install it into a virtual environment.

git clone https://github.com/DSD-DBS/capella-git-hooks
cd capella-git-hooks
python -m venv .venv

source .venv/bin/activate.sh  # for Linux / Mac
.venv\Scripts\activate  # for Windows

pip install -U pip pre-commit
pip install -e '.[docs,test]'
pre-commit install

Contributing

We'd love to see your bug reports and improvement suggestions! Please take a look at our guidelines for contributors for details.

Licenses

This project is compliant with the REUSE Specification Version 3.0.

Copyright DB Netz AG, licensed under Apache 2.0 (see full text in LICENSES/Apache-2.0.txt)

Dot-files are licensed under CC0-1.0 (see full text in LICENSES/CC0-1.0.txt)

capella-git-hooks's People

Contributors

micha91 avatar moritzweber0 avatar wuestengecko avatar

Watchers

 avatar Viktor K. avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.