Skip to content
This repository has been archived by the owner on Jul 8, 2021. It is now read-only.

Blackify #14

Merged
merged 19 commits into from
Aug 13, 2020
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .flake8
Expand Up @@ -5,8 +5,12 @@
# https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes

ignore =
# E203: whitespace before ':'
E203,
# E402: module level imports at top of file
E402,
trexfeathers marked this conversation as resolved.
Show resolved Hide resolved
# E501: line too long
E501,
# W503: line break before binary operator
W503,
# W504: line break after binary operator
Expand Down
27 changes: 27 additions & 0 deletions .pre-commit-config.yaml
@@ -0,0 +1,27 @@
# 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: 'v3.2.0'
hooks:
# Prevent giant files from being committed.
- id: check-added-large-files
# Check for files that contain merge conflict strings.
- id: check-merge-conflict
# Check for debugger imports and py37+ `breakpoint()` calls in python source.
- id: debug-statements
# Don't commit to master branch.
- id: no-commit-to-branch
- repo: https://github.com/psf/black
rev: '19.10b0'
hooks:
- id: black
# Force black to run on whole repo, using settings from pyproject.toml
pass_filenames: false
args: [--config=./pyproject.toml, .]
- repo: https://gitlab.com/pycqa/flake8
rev: '3.8.3'
hooks:
# Run flake8.
- id: flake8
args: [--config=./.flake8]
6 changes: 5 additions & 1 deletion .travis.yml
Expand Up @@ -60,7 +60,7 @@ install:
conda install --quiet -n ${ENV_NAME} --file ${CONDA_REQS_FILE};

# Conda-install our own additional dependencies.
- conda install --file conda_requirements.txt
- conda install --file requirements/conda_requirements.txt

# Output environment debug info
- >
Expand Down Expand Up @@ -90,4 +90,8 @@ install:

script:

- >
- echo $(black --version);
- black --check $(INSTALL_DIR);
trexfeathers marked this conversation as resolved.
Show resolved Hide resolved

- pytest -v ./iris_ugrid/tests
7 changes: 7 additions & 0 deletions README.md
@@ -1,2 +1,9 @@
<p align="center">
<!-- https://shields.io/ is a good source of these -->
<a href="https://github.com/psf/black">
<img src="https://img.shields.io/badge/code%20style-black-000000.svg"
alt="black" /></a>
</p>

# iris-ugrid
Unstructured mesh library for Iris
5 changes: 2 additions & 3 deletions iris_ugrid/tests/test_install.py
Expand Up @@ -14,7 +14,6 @@
def test_iris_installation():
# Check that iris cf loader includes 'exclude' functionality.
# Import a ugrid-specific test, that ought to exist on the branch.
from iris.tests.unit.fileformats.cf.test_CFReader \
import Test_exclude_vars
from iris.tests.unit.fileformats.cf.test_CFReader import Test_exclude_vars

assert hasattr(Test_exclude_vars, 'test_exclude_vars')
assert hasattr(Test_exclude_vars, "test_exclude_vars")
2 changes: 2 additions & 0 deletions pyproject.toml
@@ -0,0 +1,2 @@
[tool.black]
line-length = 79
@@ -1,2 +1,3 @@
black=19.10b0
trexfeathers marked this conversation as resolved.
Show resolved Hide resolved
gridded
pytest