Giter Club home page Giter Club logo

cl-githooks's Introduction

some python git hooks

Note: These are a work in progress.

Requirements

  • python 2.7

Current Hooks Available

  • pre-commit

Individual Installation

$ git clone https://github.com/clukawski/cl-githooks
$ cd cl-githooks
$ cp /path/to/{hookname} /path/to/project/.git/hooks/{hookname}
$ chmod +x /path/to/project/.git/hooks/{hookname}

Hook Usage/Customization

pre-commit:

This hook will make various checks to your file changes before you commit. You'll want to edit the hookconfig dictionary in main() to the tools/language you are using.

Currently the linter/unit test checks only support one language/tool each, will add support for multiple passes per check later.

  • warnfiles:

    • list of files you want warnings when committing changes to
  • linters: Linter settings

    • list of dictionaries: one for each linter/syntax/checker tool
      • extension: file extension for the linter to use
      • executable: linter executable
      • arguments: arguments to pass to the linter
      • errout: show tool stderr output (some tools will print to stderr instead of stdout)
        • set to True or False: default False
      • showout: dump raw output
        • set to True or False: default False
  • testing: Unit testing settings

    • executable: unit test tool executable
    • arguments: arguments to pass to the tool
    • testoutput: show unit test tool output
      • set to True or False
  • checks: List of enabled checks

    • lint_files: use the linter check
    • warn_files: use the file warning check
    • test_files: use unit test check
    hookconfig = {
        'warnfiles': [
            'src/test.php',
        ],
        'linters': [
            {
                'executable': 'php',
                'extension': '.php',
                'arguments': [
                    '-l'
                ],
                'errout': False,
                'showout': False
            },
            {
                'executable': 'clang',
                'extension': '.c',
                'arguments': [
                    '-fsyntax-only',
                    '-Wall',
                    '-Werror'
                ],
                'errout': True,
                'showout': False
            }
        ],
        'testing': {
            'executable': 'phpunit',
            'arguments': [
                '-v'
            ],
            'testoutput': True
        },
        'checks': [
            'lint_files',
            'warn_files',
            'test_files'
        ]
    }

cl-githooks's People

Watchers

James Cloos avatar Connie Lukawski 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.