diff --git a/.github/workflows/build-and-push.yaml b/.github/workflows/build-and-push.yaml index 0b0e681..9ff8e4b 100644 --- a/.github/workflows/build-and-push.yaml +++ b/.github/workflows/build-and-push.yaml @@ -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 \ No newline at end of file + fi diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..c58b045 --- /dev/null +++ b/.pre-commit-config.yaml @@ -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"] diff --git a/Dockerfile b/Dockerfile index cce396b..192873d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 - diff --git a/LICENSE b/LICENSE index 0f79604..d5e9ea7 100644 --- a/LICENSE +++ b/LICENSE @@ -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. \ No newline at end of file +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. diff --git a/README.md b/README.md index 9656cc8..857eca3 100644 --- a/README.md +++ b/README.md @@ -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 -``` \ No newline at end of file +``` diff --git a/environment.yml b/environment.yml index 3485963..b4a1792 100644 --- a/environment.yml +++ b/environment.yml @@ -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 diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index d81d486..b5075f4 100644 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -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/ \ No newline at end of file +py.test ${PYTEST_FLAGS} /srv/repo/image-tests/