Skip to content

Commit

Permalink
Install pre-commit (openPMD#1142)
Browse files Browse the repository at this point in the history
Add basis for automated pre-commit checks.
Install locally via:

```bash
python3 -m pip install -U pre-commit
pre-commit install
```

See: https://pre-commit.com
  • Loading branch information
ax3l authored Nov 8, 2021
1 parent 45c6bda commit 3a389a8
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
- id: check-toml
- id: check-yaml
- id: check-added-large-files
- id: requirements-txt-fixer
# - id: fix-encoding-pragma
# exclude: ^noxfile.py$

#- repo: https://github.com/asottile/pyupgrade
# rev: v2.29.0
# hooks:
# - id: pyupgrade

# Changes tabs to spaces
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.10
hooks:
- id: remove-tabs

# CMake formatting
#- repo: https://github.com/cheshirekow/cmake-format-precommit
# rev: v0.6.13
# hooks:
# - id: cmake-format
# additional_dependencies: [pyyaml]
# types: [file]
# files: (\.cmake|CMakeLists.txt)(.in)?$

# C++ formatting
# clang-format

# Python Formatting
#- repo: https://github.com/psf/black
# rev: 21.10b0 # Keep in sync with blacken-docs
# hooks:
# - id: black
#- repo: https://github.com/asottile/blacken-docs
# rev: v1.11.0
# hooks:
# - id: blacken-docs
# additional_dependencies:
# - black==21.10b0 # keep in sync with black hook

# Checks the manifest for missing files (native support)
- repo: https://github.com/mgedmin/check-manifest
rev: "0.47"
hooks:
- id: check-manifest
# This is a slow hook, so only run this if --hook-stage manual is passed
stages: [manual]
additional_dependencies: [cmake, ninja]
1 change: 1 addition & 0 deletions conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies:
- pandas
- pkg-config
- pip
- pre-commit
- pyarrow # for dask
# - pybind11 # shipped internally
- python>=3.6
Expand Down
1 change: 1 addition & 0 deletions spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ spack:
- py-numpy
- py-pandas
- py-dask
- py-pre-commit

0 comments on commit 3a389a8

Please sign in to comment.