Skip to content
Snippets Groups Projects
Select Git revision
  • 6ee8c48d3bbacab36e7fed4ef5a18f05cb5da1c9
  • main default protected
  • 429_rm_features
  • release/0.12 protected
  • pages protected
  • release/0.11 protected
  • 175_gva_migration
  • i18n
  • v0.12.0 protected
  • v0.11.2 protected
  • v0.11.1 protected
  • v0.11.0 protected
  • v0.11.0rc0 protected
  • v0.10.0 protected
  • v0.10.0rc1 protected
  • v0.10.0rc0 protected
  • v0.3.0 protected
  • v0.8.1 protected
  • v0.9.0 protected
  • v0.9.0rc protected
  • v0.8.0 protected
  • v0.7.6 protected
  • v0.7.5 protected
  • v0.7.4 protected
  • v0.7.3 protected
  • v0.7.2 protected
  • v0.7.1 protected
  • v0.7.0 protected
28 results

test_tx.py

Blame
  • pre-commit.sh 935 B
    #!/usr/bin/env bash
    
    # Initialize the variable before combine
    FILES=""
    
    for FILE in $(git diff --cached --name-only --diff-filter=ACM -z | xargs -0)
    do
        # debug
        # echo "FILE=$FILE";
    
        # do a check only on the python files
        if [[ ! $FILE =~ (\.py)$ ]]; then continue; fi
    
        FILES+="${FILE} "
    done
    
    # debug
    #echo "FILES=$FILES";
    
    # no python files, cancel...
    if [[ $FILES == "" ]]; then exit 0; fi
    
    if [[ -z "$VIRTUAL_ENV" ]]; then
        echo "No \$VIRTUAL_ENV set"
    else
        echo "\$VIRTUAL_ENV is set to $VIRTUAL_ENV"
    fi
    
    python --version
    
    # insert licence
    echo "Insert licence with insert_license..."
    insert_license --license-filepath=license_header.txt $FILES
    
    # sort import
    echo "Sort imports with isort..."
    isort $FILES
    
    # format files
    echo "Format with black..."
    black $FILES
    
    # static typing
    echo "Check static typing with mypy..."
    mypy --ignore-missing-imports $FILES
    
    # linter
    echo "Lint with ruff..."
    ruff $FILES