Skip to content
Snippets Groups Projects
Select Git revision
  • 0727be276f1ee8f1db914e3bbbed9182e7e0e6bb
  • dev default protected
  • release/1.9.1 protected
  • pini-1.8-docker
  • pini-sync-onlypeers
  • duniter-v2s-issue-123-industrialize-releases
  • feature/build-aarch64-nodejs16
  • release/1.8 protected
  • pini-docker
  • ci_tags
  • fix/1448/1.8/txs_not_stored
  • feature/node-20
  • fix/1441/node_summary_with_storage
  • fix/1442/improve_bma_tx_history
  • feature/wotwizard-1.8
  • release/1.9 protected
  • 1.7 protected
  • feature/docker-set-latest protected
  • feature/fast-docker-build-1.8.4
  • fast-docker-build protected
  • feature/dump-distance
  • v1.8.7 protected
  • v1.8.7-rc4 protected
  • v1.8.7-rc3 protected
  • v1.8.7-rc2 protected
  • v1.8.7-rc1 protected
  • v1.8.6 protected
  • v1.7.23 protected
  • v1.8.5 protected
  • v1.8.4 protected
  • v1.8.3 protected
  • v1.8.2 protected
  • v1.8.1 protected
  • v1.8.0 protected
  • v1.8.0-rc1 protected
  • v1.8.0-beta5 protected
  • v1.8.0-beta4 protected
  • v1.8.0-beta3 protected
  • v1.8.0-beta2 protected
  • v1.8.0-beta protected
  • v1.7.21 protected
41 results

index.ts

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