- 
                Notifications
    You must be signed in to change notification settings 
- Fork 232
Development environment
        Leopold Talirz edited this page Dec 4, 2018 
        ·
        23 revisions
      
    The AiiDA pre-commit hooks help you write clean code by running
- code formatting
- syntax checking
- static analysis
- checks for missing docstrings
- checks for consistency of dependencies and version numbers
- ...
locally at every commit you make. We currently use yapf and prospector, but more tools may follow.
Set up the hooks as follows:
cd aiida_core pip install -e .[dev_precommit] pre-commit install pre-commit run # test running the hooks # from now on, hooks will check changed files on every commit
Note:
- If you work in a condaenvironment, you may need toconda install virtualenvto avoid problems with virtualenv inside conda.
- On Ubuntu-18.04 you may need to sudo apt install ruby-dev
- Use pre-commit runto run the checks without committing
- If you ever need to commit a 'work in progress' you may skip the checks via git commit --no-verify. Yet, keep in mind that the pre-commit hooks will also run (and fail) at the continuous integration stage when you push them upstream.
- For historical reasons, some code files are excluded from pre-commit checks in aiida. When touching such a file, please try to remove them from the exclude list .pre-commit-config.yaml.