Skip to content

Commit 5d8b214

Browse files
author
Joseph Hamman
committed
add pre-commit and lint files
1 parent 792849f commit 5d8b214

20 files changed

Lines changed: 916 additions & 12065 deletions

.binder/Welcome.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ For more information about these examples please visit [github.com/xarray-contri
2222
Where is this running?
2323
----------------------
2424

25-
This session is running on [mybinder.org](https://mybinder.org), a service designed and maintained by the Jupyter community, generously funded by the Gordon and Betty Moore Foundation.
25+
This session is running on [mybinder.org](https://mybinder.org), a service designed and maintained by the Jupyter community, generously funded by the Gordon and Betty Moore Foundation.

.binder/environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ dependencies:
2323
- gsw
2424
- pip
2525
- pip:
26-
- expectexception
26+
- expectexception

.binder/jupyterlab-workspace.json

Lines changed: 88 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,94 @@
11
{
2-
"data": {
3-
"file-browser-filebrowser:cwd": {
4-
"path": ""
5-
},
6-
"dask-dashboard-launcher:individual-progress": {
7-
"data": {
8-
"route": "individual-progress",
9-
"label": "Progress"
10-
}
11-
},
12-
"dask-dashboard-launcher:individual-task-stream": {
13-
"data": {
14-
"route": "individual-task-stream",
15-
"label": "Task Stream"
16-
}
17-
},
18-
"layout-restorer:data": {
19-
"main": {
20-
"dock": {
21-
"type": "split-area",
22-
"orientation": "horizontal",
23-
"sizes": [
24-
0.5,
25-
0.5
26-
],
27-
"children": [
28-
{
29-
"type": "tab-area",
30-
"currentIndex": 0,
31-
"widgets": [
32-
"markdownviewer-widget:Welcome.md"
33-
]
34-
},
35-
{
36-
"type": "split-area",
37-
"orientation": "vertical",
38-
"sizes": [
39-
0.67,
40-
0.33
41-
],
42-
"children": [
43-
{
44-
"type": "tab-area",
45-
"currentIndex": 0,
46-
"widgets": [
47-
"dask-dashboard-launcher:individual-task-stream"
48-
]
49-
},
50-
{
51-
"type": "tab-area",
52-
"currentIndex": 0,
53-
"widgets": [
54-
"dask-dashboard-launcher:individual-progress"
55-
]
56-
}
57-
]
58-
}
59-
]
60-
},
61-
"mode": "multiple-document",
62-
"current": "markdownviewer-widget:Welcome.md"
63-
},
64-
"left": {
65-
"collapsed": false,
66-
"current": "filebrowser",
67-
"widgets": [
68-
"filebrowser",
69-
"running-sessions",
70-
"dask-dashboard-launcher",
71-
"command-palette",
72-
"tab-manager"
73-
]
2+
"data": {
3+
"file-browser-filebrowser:cwd": {
4+
"path": ""
5+
},
6+
"dask-dashboard-launcher:individual-progress": {
7+
"data": {
8+
"route": "individual-progress",
9+
"label": "Progress"
10+
}
11+
},
12+
"dask-dashboard-launcher:individual-task-stream": {
13+
"data": {
14+
"route": "individual-task-stream",
15+
"label": "Task Stream"
16+
}
17+
},
18+
"layout-restorer:data": {
19+
"main": {
20+
"dock": {
21+
"type": "split-area",
22+
"orientation": "horizontal",
23+
"sizes": [
24+
0.5,
25+
0.5
26+
],
27+
"children": [
28+
{
29+
"type": "tab-area",
30+
"currentIndex": 0,
31+
"widgets": [
32+
"markdownviewer-widget:Welcome.md"
33+
]
7434
},
75-
"right": {
76-
"collapsed": true,
77-
"widgets": []
78-
}
79-
},
80-
"markdownviewer-widget:Welcome.md": {
81-
"data": {
82-
"path": "Welcome.md",
83-
"factory": "Markdown Preview"
35+
{
36+
"type": "split-area",
37+
"orientation": "vertical",
38+
"sizes": [
39+
0.67,
40+
0.33
41+
],
42+
"children": [
43+
{
44+
"type": "tab-area",
45+
"currentIndex": 0,
46+
"widgets": [
47+
"dask-dashboard-launcher:individual-task-stream"
48+
]
49+
},
50+
{
51+
"type": "tab-area",
52+
"currentIndex": 0,
53+
"widgets": [
54+
"dask-dashboard-launcher:individual-progress"
55+
]
56+
}
57+
]
8458
}
59+
]
8560
},
86-
"dask-dashboard-launcher": {
87-
"url": "DASK_DASHBOARD_URL",
88-
"cluster": ""
89-
}
61+
"mode": "multiple-document",
62+
"current": "markdownviewer-widget:Welcome.md"
63+
},
64+
"left": {
65+
"collapsed": false,
66+
"current": "filebrowser",
67+
"widgets": [
68+
"filebrowser",
69+
"running-sessions",
70+
"dask-dashboard-launcher",
71+
"command-palette",
72+
"tab-manager"
73+
]
74+
},
75+
"right": {
76+
"collapsed": true,
77+
"widgets": []
78+
}
79+
},
80+
"markdownviewer-widget:Welcome.md": {
81+
"data": {
82+
"path": "Welcome.md",
83+
"factory": "Markdown Preview"
84+
}
9085
},
91-
"metadata": {
92-
"id": "/lab"
86+
"dask-dashboard-launcher": {
87+
"url": "DASK_DASHBOARD_URL",
88+
"cluster": ""
9389
}
94-
}
90+
},
91+
"metadata": {
92+
"id": "/lab"
93+
}
94+
}

.github/workflows/main.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
branches: master
88

99
jobs:
10+
pre-commit:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v1
14+
- uses: actions/setup-python@v1
15+
- uses: pre-commit/action@v2.0.0
1016
test:
1117
name: Tutorial Testing
1218
runs-on: ubuntu-latest
@@ -47,4 +53,4 @@ jobs:
4753
python -m pip install --upgrade pip
4854
python -m pip install jupyter-repo2docker
4955
- name: Build xarray-tutorial Docker image
50-
run: jupyter-repo2docker --no-run --debug .
56+
run: jupyter-repo2docker --no-run --debug .

.isort.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[settings]
2+
known_third_party = nbconvert,nbformat

.pre-commit-config.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
repos:
2+
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v2.5.0
5+
hooks:
6+
- id: trailing-whitespace
7+
- id: end-of-file-fixer
8+
- id: check-docstring-first
9+
- id: check-json
10+
- id: check-yaml
11+
- id: pretty-format-json
12+
args: ["--autofix", "--indent=2", "--no-sort-keys"]
13+
14+
- repo: https://github.com/ambv/black
15+
rev: 19.10b0
16+
hooks:
17+
- id: black
18+
args: ["--line-length", "100"]
19+
20+
- repo: https://gitlab.com/pycqa/flake8
21+
rev: 3.8.0a2
22+
hooks:
23+
- id: flake8
24+
25+
- repo: https://github.com/asottile/seed-isort-config
26+
rev: v2.1.1
27+
hooks:
28+
- id: seed-isort-config
29+
- repo: https://github.com/pre-commit/mirrors-isort
30+
rev: v4.3.21
31+
hooks:
32+
- id: isort
33+
34+
- repo: https://github.com/deathbeds/prenotebook
35+
rev: master
36+
hooks:
37+
- id: prenotebook
38+
39+
- repo: https://github.com/myint/rstcheck
40+
rev: master
41+
hooks:
42+
- id: rstcheck

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ script:
3434
- doctr deploy --built-docs _build/html .
3535

3636
notifications:
37-
email: false
37+
email: false

README.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,11 @@ This repository is a great opportunity to start contributing to Xarray.
1818
Please note that examples submitted to this repository should follow these
1919
guidelines:
2020

21-
1. Run top-to-bottom without intervention from the user
22-
2. Not require external data sources that may disappear over time
23-
(external data sources that are highly unlikely to disappear are fine)
24-
3. Not be resource intensive, and should run within 2GB of memory
25-
4. Be clear and contain enough prose to explain the topic at hand
26-
5. Be concise and limited to one or two topics, such that a reader can
27-
get through the example within a few minutes of reading
28-
6. Be of general relevance to Xarray users, and so not too specific on a
29-
particular problem or use case.
21+
1. Run top-to-bottom without intervention from the user
22+
2. Not require external data sources that may disappear over time (external data sources that are highly unlikely to disappear are fine)
23+
3. Not be resource intensive, and should run within 2GB of memory
24+
4. Be clear and contain enough prose to explain the topic at hand
25+
5. Be concise and limited to one or two topics, such that a reader can get through the example within a few minutes of reading
26+
6. Be of general relevance to Xarray users, and so not too specific on a particular problem or use case.
3027

3128
*Note: Some of the content in this repository came from a similar projects: https://github.com/dask/dask-tutorial*

0 commit comments

Comments
 (0)