NodeChain EN
  • NodeChain
  • Learn
    • About NodeChain
    • Infrastructure
      • Connector
        • Wrapper APIs
      • Nodes
      • Startup script
    • License
    • Ecosystem
      • Supported APIs
      • Integrations
      • Acknowledgments
  • Develop
    • Quick start
      • Initial setup
      • Using command-line script
        • Commands
    • How-to
      • Run tests locally
      • Lint automatically with hooks
      • Integrate a new Blockchain/API
      • Connect to a public node
    • Wrapper API definition file
    • Contributing
  • Reference
    • API Reference
      • Admin
      • General Endpoints
      • REST Wrapper API
        • Bitcoin Cash
        • Bitcoin
        • Ethereum
          • ERC-20
      • JSON-RPC Wrapper API
        • Bitcoin Cash
        • Bitcoin
        • Ethereum
          • ERC-20
      • Real-Time Wrapper API
        • Bitcoin
        • Ethereum
Powered by GitBook
On this page
  1. Develop
  2. How-to

Lint automatically with hooks

Follow the steps to create a pre-commit hook

  1. Create the file pre-commit inside the path .git/hooks/ of your local repository with this content:

#!/bin/bash

ROOT_DIR="$(git rev-parse --show-toplevel)"

echo "Running Flake8"
flake8 ${ROOT_DIR} --statistics
  1. Assign it execution permission

$ chmod +x .git/hooks/pre-commit
PreviousRun tests locallyNextIntegrate a new Blockchain/API

Last updated 3 years ago