Skip to content

Commit

Permalink
Set up basic pre-commits
Browse files Browse the repository at this point in the history
* black (source code formatting)
* syntax validation
* basic flake8 checks

Add an entry point to enable pre-commits if the package is installed
in a dials environment.
  • Loading branch information
Anthchirp committed May 3, 2019
1 parent d1f48f7 commit b77c8a5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
repos:

# Automatic source code formatting
- repo: https://github.com/ambv/black
rev: stable
hooks:
- id: black
args: [--safe, --quiet]

# Syntax check and some basic flake8
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.0.0
hooks:
- id: check-ast
- id: flake8
args: ['--max-line-length=88', '--select=W291,W292,W293,F401']
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
],
entry_points={"libtbx.precommit": ["ispyb = ispyb"]},
project_urls={"Documentation": "https://ispyb.readthedocs.io"},
)

0 comments on commit b77c8a5

Please sign in to comment.