From 7f1233fe385dd5edb80ac1fce670aaa8490e6ec8 Mon Sep 17 00:00:00 2001 From: Eric Neilsen Date: Fri, 22 Mar 2024 12:16:09 -0700 Subject: [PATCH 1/2] Add pre-commit hook --- .pre-commit-config.yaml | 5 +++++ README.md | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..af61602 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,5 @@ +repos: + - repo: https://github.com/kynan/nbstripout + rev: 0.6.1 + hooks: + - id: nbstripout diff --git a/README.md b/README.md index af25701..b712274 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,11 @@ # schedview_notebooks Notebooks associated with schedview, sometimes for execution by Times Square + +## Development + +This repository uses Pre-commit to keep notebooks formatted and clean. Install Pre-commit by running: + +```bash +pip install pre-commit +pre-commit install +``` From 35b558888e58af09e8d2e9143a782924c59a2577 Mon Sep 17 00:00:00 2001 From: Eric Neilsen Date: Fri, 22 Mar 2024 13:05:27 -0700 Subject: [PATCH 2/2] pre-commit github workflow --- .github/workflows/ci.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..02ea8ef --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,22 @@ +name: CI + +"on": + merge_group: {} + pull_request: {} + push: {} + +jobs: + lint: + runs-on: ubuntu-latest + timeout-minutes: 5 + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Run pre-commit + uses: pre-commit/action@v3.0.0