Skip to content

Instantly share code, notes, and snippets.

@toff63
Last active September 15, 2016 22:56
Show Gist options
  • Save toff63/c3b6f4e4b80e6aaeeeb604dad09efda5 to your computer and use it in GitHub Desktop.
Save toff63/c3b6f4e4b80e6aaeeeb604dad09efda5 to your computer and use it in GitHub Desktop.

Revisions

  1. toff63 revised this gist Sep 14, 2016. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions pylint-git-pre-commit-hook.md
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,15 @@
    1. Install git-pylint-commit-hook
    ## Install git-pylint-commit-hook
    ```
    $ pip install git-pylint-commit-hook
    ```
    2. Add git pylint to a git repo as a hook
    ## Add git pylint to a git repo as a hook
    ```
    $ cd my_git_repo/.git/hooks
    $ echo '#!/bin/sh
    git-pylint-commit-hook
    ' > pre-commit
    ```
    3. Make the script runnable
    ## Make the script runnable
    ```
    chmod 755 my_git_repo/.git/hooks
    ```
  2. toff63 revised this gist Sep 14, 2016. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions pylint-git-pre-commit-hook.md
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,14 @@
    1. Install git-pylint-commit-hook
    ```
    ```
    $ pip install git-pylint-commit-hook
    ```
    ```
    2. Add git pylint to a git repo as a hook
    ```
    ```
    $ cd my_git_repo/.git/hooks
    $ echo '#!/bin/sh
    git-pylint-commit-hook
    ' > pre-commit
    ```
    ```
    3. Make the script runnable
    ```
    chmod 755 my_git_repo/.git/hooks
  3. toff63 revised this gist Sep 14, 2016. 1 changed file with 18 additions and 10 deletions.
    28 changes: 18 additions & 10 deletions pylint-git-pre-commit-hook.md
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,22 @@
    1. Install git-pylint-commit-hook
    pip install git-pylint-commit-hook
    ```
    $ pip install git-pylint-commit-hook
    ```
    2. Add git pylint to a git repo as a hook
    cd my_git_repo/.git/hooks
    echo '#!/bin/sh
    git-pylint-commit-hook
    ' > pre-commit
    ```
    $ cd my_git_repo/.git/hooks
    $ echo '#!/bin/sh
    git-pylint-commit-hook
    ' > pre-commit
    ```
    3. Make the script runnable
    chmod 755 my_git_repo/.git/hooks
    ```
    chmod 755 my_git_repo/.git/hooks
    ```
    4. Test committing a python script
    git commit -m 'Update my_file.py format to comply with PEP8'
    // Running pylint on my_file.py (file 1/1).. 9.8/10.00 PASSED
    // [master 3296b3d] Update my_file.py format to comply with PEP8
    // file changed, 15 insertions(+), 4 deletions(-)
    ```
    git commit -m 'Update my_file.py format to comply with PEP8'
    // Running pylint on my_file.py (file 1/1).. 9.8/10.00 PASSED
    // [master 3296b3d] Update my_file.py format to comply with PEP8
    // file changed, 15 insertions(+), 4 deletions(-)
    ```
  4. toff63 created this gist Sep 14, 2016.
    14 changes: 14 additions & 0 deletions pylint-git-pre-commit-hook.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    1. Install git-pylint-commit-hook
    pip install git-pylint-commit-hook
    2. Add git pylint to a git repo as a hook
    cd my_git_repo/.git/hooks
    echo '#!/bin/sh
    git-pylint-commit-hook
    ' > pre-commit
    3. Make the script runnable
    chmod 755 my_git_repo/.git/hooks
    4. Test committing a python script
    git commit -m 'Update my_file.py format to comply with PEP8'
    // Running pylint on my_file.py (file 1/1).. 9.8/10.00 PASSED
    // [master 3296b3d] Update my_file.py format to comply with PEP8
    // file changed, 15 insertions(+), 4 deletions(-)