Skip to content

Commit dda3107

Browse files
committed
Apply autoformatting
1 parent 4133f74 commit dda3107

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2308
-1854
lines changed

.flake8

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[flake8]
2+
# Ignore style and complexity
3+
# E: style errors
4+
# W: style warnings
5+
# F401: module imported but unused
6+
# F811: redefinition of unused `name` from line `N`
7+
# F841: local variable assigned but never used
8+
ignore = E, C, W, F401, F403, F811, F841, E402, I100, I101, D400
9+
exclude =
10+
helm-chart,
11+
hooks,
12+
setup.py,
13+
statuspage,
14+
versioneer.py

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ repos:
1414
- id: end-of-file-fixer
1515
- id: check-json
1616
- id: check-yaml
17+
exclude: ^helm-chart/nbviewer/templates/
1718
- id: check-case-conflict
1819
- id: check-executables-have-shebangs
1920
- id: requirements-txt-fixer

.travis.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,32 @@ install:
1818
- pip install -r requirements.txt
1919
- pip install -e .
2020

21+
# run tests
2122
script:
2223
- invoke test
2324

25+
# list the jobs
26+
jobs:
27+
include:
28+
- name: autoformatting check
29+
python: 3.6
30+
# NOTE: It does not suffice to override to: null, [], or [""]. Travis will
31+
# fall back to the default if we do.
32+
before_install: echo "Do nothing before install."
33+
install: pip install pre-commit
34+
script:
35+
- pre-commit run --all-files
36+
after_success: echo "Do nothing after success."
37+
after_failure:
38+
- |
39+
echo "You can install pre-commit hooks to automatically run formatting"
40+
echo "on each commit with:"
41+
echo " pre-commit install"
42+
echo "or you can run by hand on staged files with"
43+
echo " pre-commit run"
44+
echo "or after-the-fact on already committed files with"
45+
echo " pre-commit run --all-files"
46+
2447
env:
2548
global:
2649
- secure: Sv53YMdsVTin1hUPRqIuvdAOJ0UwklEowW49qpxY9wSgiAM79D+e1b5Yxrn+RTtS3WGlvK1aKHICc+2ajccEJkKFL8WDy2SnTnoWPadrEy4NAGLkNMGK+bAYMnLNoNRbSGVz5JpvNJ7JkeaEplhJ572OJOxa1X7ZF9165ZbOWng=

CONTRIBUTING.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ for a friendly and welcoming collaborative environment.
99

1010
## Setting up a development environment
1111

12-
See the instructions for local development or local installation first. Next, set up pre-commit hooks for automatic code formatting, etc.
12+
See the instructions for local development or local installation first.
13+
14+
NBViewer has adopted automatic code formatting so you shouldn't
15+
need to worry too much about your code style.
16+
As long as your code is valid,
17+
the pre-commit hook should take care of how it should look. Here is how to set up pre-commit hooks for automatic code formatting, etc.
1318

1419
```bash
1520
pre-commit install
@@ -20,22 +25,17 @@ See the instructions for local development or local installation first. Next, se
2025
```bash
2126
pre-commit run
2227
```
23-
24-
NBViewer has adopted automatic code formatting so you shouldn't
25-
need to worry too much about your code style.
26-
As long as your code is valid,
27-
the pre-commit hook should take care of how it should look.
28-
You can invoke the pre-commit hook by hand at any time with:
29-
30-
```bash
31-
pre-commit run
32-
```
33-
28+
3429
which should run any autoformatting on your code
3530
and tell you about any errors it couldn't fix automatically.
3631
You may also install [black integration](https://github.com/ambv/black#editor-integration)
3732
into your text editor to format code automatically.
3833

34+
If you have already committed files before setting up the pre-commit
35+
hook with `pre-commit install`, you can fix everything up using
36+
`pre-commit run --all-files`. You need to make the fixing commit
37+
yourself after that.
38+
3939
#### Running the Tests
4040

4141
It's a good idea to write tests to exercise any new features,

LICENSE.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,3 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
3333
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
3434
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3535
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36-

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ nbviewer:
55
ports:
66
- 8080:8080
77
nbcache:
8-
image: memcached
8+
image: memcached

nbviewer/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
from ._version import get_versions
2-
__version__ = get_versions()['version']
2+
3+
__version__ = get_versions()["version"]
34
del get_versions

nbviewer/__main__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
from nbviewer.app import main
2+
23
main()

0 commit comments

Comments
 (0)