Code Monkey home page Code Monkey logo

pre-commit-hooks-qcab's Introduction

pre-commit-hooks

Some pre-commit hooks for OpenMMLab projects.

Using pre-commit-hooks with pre-commit

Add this to your .pre-commit-config.yaml

-   repo: https://github.com/open-mmlab/pre-commit-hooks
    rev: v0.4.1  # Use the ref you want to point at
    hooks:
    -   id: check-algo-readme
    -   id: check-copyright
        args: ["dir_to_check"]  # replace the dir_to_check with your expected directory to check
    -   id: check-ecosystem-validity
        args: [projects_index.yaml]
        additional_dependencies:
          - cerberus
    -   id: remove-improper-eol-in-cn-docs

Hooks available

say-hello

A template to show how to implement a pre-commit hook

check-algo-readme

Check whether the abstract and icon exist in the algorithm readme.

  • --debug - print details of abstract and icon in dict format.
  • --dry-run - just dry run, igonre failed use case.
  • --model-index ${MODEL_INDEX} - custom model-index file path.

check-copyright

Check whether the code contains copyright

  • includes - directory to add copyright.
  • --excludes - exclude directory.
  • --suffixes - copyright will be added to files with suffix.
  • --ignore-file-not-found-error - Whether to ignore FileNotFoundError when some directories are specified to add copyright but they are not found.

check-ecosystem-validity

Check the validity of the ecosystem yaml file

  • filename - path of the project yaml
  - repo: https://github.com/open-mmlab/pre-commit-hooks
    rev: v0.4.1
    hooks:
    -   id: check-ecosystem-validity
        args: [projects_index.yaml]
        additional_dependencies:
          - cerberus

remove-improper-eol-in-cn-docs

Remove end-of-line characters that split natural paragraphs in Chinese docs.

This helps resolve extra whitespaces in Chinese Markdown docs described here, as a long-standing HTML rendering issue. For example,

这是一个, 像诗一样的 测试

will be changed to:

这是一个,像诗一样的测试

Usage:

  - repo: https://github.com/open-mmlab/pre-commit-hooks
    rev: v0.4.1
    hooks:
    -   id: remove-improper-eol-in-cn-docs

check-baidu-heading

Automatic add heading to pass BAIDU's NONSENSE icode coding check.

Usage:

  - repo: https://github.com/FreakieHuang/pre-commit-hooks-qcab
    rev: v1.0.8
    hooks:
      - id: check-baidu-heading
        args: [ "name", "of", "folders"]

pre-commit-hooks-qcab's People

Contributors

c1rn09 avatar fpshuang avatar pentahill avatar teamwong111 avatar tonysy avatar vansin avatar zhouzaida avatar

Watchers

 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.