forked from opendatacube/eo-datasets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
49 lines (48 loc) · 2.36 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
# Test data is supposed to be verbatim, including errors. Exclude it from linting.
exclude: tests/integration/data
repos:
# Normalise all Python code. (Black + isort + pyupgrade + autoflake)
- repo: https://github.com/Zac-HD/shed
rev: 2023.6.1
hooks:
- id: shed
- repo: https://github.com/PyCQA/flake8
# flake8 version should match .travis.yml
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies:
- dlint # Check common security issues
- flake8-broken-line # Don't escape newlines. (surround in parens or simplify)
- flake8-debugger # Don't commit debugger calls
- flake8-executable # Check shebangs and executable permissions
- flake8-logging-format # Use log arguments, not string format
- flake8-pep3101 # Don't use old string % formatting
- flake8-pytest # Use plain assert, not unittest assertions
- pep8-naming # Follow pep8 naming rules (eg. function names lowercase)
# Common Python security checks. (this is complementary to dlint in flake8)
- repo: https://github.com/PyCQA/bandit
rev: '1.7.6'
hooks:
- id: bandit
exclude: '^tests/|_version.py|versioneer.py'
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files # We don't want huge files. (Cut down test data!)
args: ['--maxkb=3000']
- id: check-case-conflict # Don't allow files that differ by case sensitivity.
- id: check-docstring-first # Avoid common error of code before docstring.
- id: check-json # Check json file syntax
- id: check-merge-conflict
- id: check-symlinks # Symlinks that don't point to anything?
- id: check-yaml # Check Yaml file syntax
- id: debug-statements # Avoid commiting debug/breakpoints
- id: end-of-file-fixer # Normalise on exactly one newline
- id: fix-byte-order-marker # No UTF-8 byte order marks
- id: mixed-line-ending # Don't allow mixed line endings
- id: pretty-format-json
args: ['--no-sort-keys', '--indent=4', '--autofix']
- id: requirements-txt-fixer # Keep requirements files sorted.
- id: trailing-whitespace # Auto remove trailing whitespace