Skip to content

Commit

Permalink
Merge pull request #784 from ipython/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Oct 11, 2022
2 parents e358fa7 + 9fd01cc commit c409411
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 25 deletions.
20 changes: 13 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 22.8.0
rev: 22.10.0
hooks:
- id: black
args: ["--line-length", "100"]
Expand All @@ -38,21 +38,27 @@ repos:
args: [--profile=black]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.981
rev: v0.982
hooks:
- id: mypy
args: ["--config-file", "pyproject.toml"]
exclude: "traitlets/.*tests/.*.py"
additional_dependencies: [pytest, types-docutils, sphinx]
stages: [manual]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.0
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.10.1
hooks:
- id: prettier
- id: validate-pyproject
stages: [manual]

- repo: https://github.com/executablebooks/mdformat
rev: 0.7.16
hooks:
- id: mdformat

- repo: https://github.com/asottile/pyupgrade
rev: v2.38.2
rev: v3.1.0
hooks:
- id: pyupgrade
args: [--py37-plus]
Expand All @@ -73,7 +79,7 @@ repos:
stages: [manual]

- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.24.0
rev: v8.25.0
hooks:
- id: eslint
stages: [manual]
Expand Down
6 changes: 4 additions & 2 deletions COPYING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,7 @@ change to one of the IPython repositories.
With this in mind, the following banner should be used in any source code file
to indicate the copyright and license terms:

# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
```
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
```
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,16 @@ the pre-commit hook should take care of how it should look.

To install `pre-commit` locally, run the following::

pip install pre-commit
pre-commit install
```
pip install pre-commit
pre-commit install
```

You can invoke the pre-commit hook by hand at any time with::

pre-commit run
```
pre-commit run
```

which should run any autoformatting on your code
and tell you about any errors it couldn't fix automatically.
Expand Down
42 changes: 29 additions & 13 deletions docs/readme-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,53 @@ is hosted on ReadTheDocs.

#### Change directory to documentation root:

cd docs
```
cd docs
```

#### Create environment

- [**conda**] Create conda env (and install relevant dependencies):
- \[**conda**\] Create conda env (and install relevant dependencies):

conda env create -f environment.yml
```
conda env create -f environment.yml
```

- [**pip**] Create virtual environment (and install relevant dependencies):
- \[**pip**\] Create virtual environment (and install relevant dependencies):

virtualenv traitlets_docs -p python3
pip install -r requirements.txt
```
virtualenv traitlets_docs -p python3
pip install -r requirements.txt
```

#### Activate the newly built environment `traitlets_docs`

- [**conda**] Activate conda env:
- \[**conda**\] Activate conda env:

source activate traitlets_docs
```
source activate traitlets_docs
```

- [**pip**] The virtualenv should have been automatically activated. If
- \[**pip**\] The virtualenv should have been automatically activated. If
not:

source activate
```
source activate
```

#### Build documentation using:

- Makefile for Linux and OS X:

make html
```
make html
```

- make.bat for Windows:

make.bat html
```
make.bat html
```

#### Display the documentation locally

Expand All @@ -48,7 +62,9 @@ is hosted on ReadTheDocs.
- Or alternatively you may run a local server to display
the docs. In Python 3:

python -m http.server 8000
```
python -m http.server 8000
```

In your browser, go to `http://localhost:8000`.

Expand Down

0 comments on commit c409411

Please sign in to comment.