Skip to content

Commit

Permalink
Install and use pre-commit (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrjones authored Sep 6, 2024
1 parent 2832758 commit f52618b
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ jobs:
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
docker push $FULL_IMAGE_NAME:latest || exit 1
echo "Pushed image: $FULL_IMAGE_NAME:latest"
fi
fi
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-json
- id: check-toml
- id: check-xml
- id: debug-statements
- id: check-builtin-literals
- id: check-case-conflict
- id: detect-private-key

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 'v0.5.0'
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ COPY --chown=${NB_USER}:${NB_USER} install-vscode-ext.sh ${HOME}/.kernels/instal
RUN bash ${HOME}/.kernels/install-vscode-ext.sh
COPY --chown=${NB_USER}:${NB_USER} image-tests /srv/repo/image-tests
COPY --chown=${NB_USER}:${NB_USER} scripts /srv/repo/scripts

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ To run the tests locally, run the following command:
```bash
docker build -t pangeo-notebook-veda .
docker run pangeo-notebook-veda bash /srv/repo/scripts/run_tests.sh
```
```
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies:
- code-server>=3.2
- jupyter-vscode-proxy
- openssh
- pre_commit
- pip
- pip:
- git+https://github.com/MAAP-Project/stac_ipyleaflet.git@0.3.6
Expand Down
2 changes: 1 addition & 1 deletion scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ ls /srv/repo/image-tests/*.ipynb > /dev/null && \
echo "Regenerating notebook outputs..." && \
export PYTEST_FLAGS="--nb-force-regen ${PYTEST_FLAGS}";

py.test ${PYTEST_FLAGS} /srv/repo/image-tests/
py.test ${PYTEST_FLAGS} /srv/repo/image-tests/

0 comments on commit f52618b

Please sign in to comment.