Git Product home page Git Product logo

pre-commit-jgstew's Introduction

pre-commit-hooks

custom pre-commit hooks by JGStew.

This repository contains hooks for pre-commit that may be useful to devs.

Requirements

To use these hooks, you first need to install pre-commit using the instructions here: https://pre-commit.com/#install

Adding hooks to your pre-commit config

For any hook in this repo you wish to use, add the following to your pre-commit config file .pre-commit-config.yaml:

---
repos:
  - repo: https://github.com/jgstew/pre-commit-jgstew
    rev: v1.0.0
    hooks:
    -   id: minimum-changes

After adding a hook to your pre-commit config, it's not a bad idea to run pre-commit autoupdate to ensure you have the latest version of the hooks.

Test commands:

  • test python import and version: python -c "import pre_commit_hooks; print(pre_commit_hooks.__version__)"
  • test version defined through setup.py: python setup.py --version
    • version defined in setup.cfg: version = attr: pre_commit_hooks.__version__
  • test builds:
    • python .\setup.py build
    • python -m build
  • test pre-commit locally: pre-commit try-repo .

Related:

pre-commit-jgstew's People

Contributors

jgstew avatar dependabot[bot] avatar

Watchers

 avatar

pre-commit-jgstew's Issues

add hook to automatically switch unicode characters to nearest equivalent.

use unidecode python module to switch non ascii characters within UTF8 to nearest ascii equivalent.

            with open(this_path) as f:
                file_contents = f.read()

            if not file_contents.isascii():
                print(
                    f"Invalid: {dirpath} - {filename} contained non-ascii chars found by Python"
                )
                with open(this_path, "wt", encoding="utf-8") as this_file:
                    this_file.write(unidecode(file_contents))

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.