Skip to content

Commit 934701d

Browse files
authored
Merge pull request #36 from DocOtak/pre-commit
Add pre commit
2 parents 72249dd + 7102baf commit 934701d

File tree

7 files changed

+203
-3
lines changed

7 files changed

+203
-3
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.209.5/containers/python-3/.devcontainer/base.Dockerfile
22

33
# [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster
4-
ARG VARIANT="3.10-bullseye"
4+
ARG VARIANT="3.8-bullseye"
55
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
66

77
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6
1010
// Append -bullseye or -buster to pin to an OS version.
1111
// Use -bullseye variants on local on arm64/Apple Silicon.
12-
"VARIANT": "3.9-bullseye",
12+
"VARIANT": "3.8-bullseye",
1313
// Options
1414
"NODE_VERSION": "lts/*"
1515
}

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ on:
1010
branches: [ master ]
1111

1212
jobs:
13+
style:
14+
name: Code linting checks
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: psf/black@stable
19+
with:
20+
options: "--check --verbose"
21+
version: "22.1.0"
22+
1323
build:
1424
name: build (${{ matrix.os }}, ${{ matrix.python-version }})
1525
runs-on: ${{ matrix.os }}

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/psf/black
5+
rev: 22.1.0
6+
hooks:
7+
- id: black
8+
language_version: python3.8

gsw_xarray/tests/test_units.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def test_unit_pint(func_name):
2929
print(a["units"])
3030
ureg.Unit(a["units"])
3131

32+
3233
@pytest.mark.parametrize("func_name", gsw_base)
3334
def test_unit_cf_units(func_name):
3435
cf_units = pytest.importorskip("cf_units")

poetry.lock

Lines changed: 181 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ furo = {version = ">=2022.1.2", optional = true}
1515
[tool.poetry.dev-dependencies]
1616
pytest = ">=6.2.5"
1717
Pint = ">=0.18"
18+
pre-commit = "^2.17.0"
1819

1920
[tool.poetry.extras]
2021
docs = ["Sphinx", "furo"]

0 commit comments

Comments
 (0)