diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000..53dde399b6 --- /dev/null +++ b/.pre-commit-config.yaml @@ -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] diff --git a/conda.yml b/conda.yml index fa71660ab8..4f450c790a 100644 --- a/conda.yml +++ b/conda.yml @@ -33,6 +33,7 @@ dependencies: - pandas - pkg-config - pip + - pre-commit - pyarrow # for dask # - pybind11 # shipped internally - python>=3.6 diff --git a/spack.yaml b/spack.yaml index 2b2f1e8cfb..3fdf933d31 100644 --- a/spack.yaml +++ b/spack.yaml @@ -16,3 +16,4 @@ spack: - py-numpy - py-pandas - py-dask + - py-pre-commit