Skip to content

Commit

Permalink
Merge pull request #3 from cal-itp/update-repo
Browse files Browse the repository at this point in the history
Update repo pt.II
  • Loading branch information
natam1 committed Jun 25, 2024
2 parents d4e768f + e9f28e4 commit d5aaba5
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 17 deletions.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATES/research_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Research Request
about: Use this template for to track a requests we receive.
title: Research Request- [Summary]
labels: 'research request'
assignees: ''
---

# Research Request

Complete this issue to detail any research requests we recieve from internal or external partners. This issue is best for describing what type of work will be done. This research request can be followed up by one or more Research Tasks.

## Project Description
* **Relevant PRs or Reserach Requests** (if applicable):

* **Question or Goal**: overarching goal of this issue

* **Data Required**:
* Currently have:
* Need:

* **Research Required**:

* **Expected Outputs / Findings**: what do you hope to have created when this is complete?
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
---
name: Research Request
name: Research Task
about: Use this template for work that is either stand alone or a part of a bigger project.
title: Research Request- [Summary]
labels: 'research request'
title: Research Task- [Summary]
labels: 'research task'
assignees: ''
---

# Research Request
# Research Task

Complete this issue to track work that is either stand alone or a smaller part of a bigger project.

## Project Description
* **Relevant PR** (if applicable):

* **Question or Goal**: overarching goal of this issue
* **Question or Goal**: what does this task aim to address?

* **Data Required**:
* Currently have:
* Need:

* **Research Required**:
* **Tasks Required**:

* **Metrics**: what specific calculations are you looking to find?
* **Metrics**: what, if any, specific calculations are you looking to find?

* **Expected Outputs / Findings**: what do you hope to have created when this is complete?
44 changes: 44 additions & 0 deletions .github/workflows/nbviewer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Generate nbviewer links

on:
pull_request:
types:
- opened
- edited
paths:
- "**.ipynb"

jobs:
nbviewer-links:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: get files
id: files
uses: jitterbit/get-changed-files@v1
continue-on-error: true

- name: add comments
uses: actions/github-script@v3
env:
FILES: ${{steps.files.outputs.all}}
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const body = process.env.FILES
.split(" ")
.filter(f => (f.endsWith(".ipynb") && !f.startsWith("portfolio/")))
.map(f => `* [${f}](https://nbviewer.jupyter.org/github/${context.repo.owner}/${context.repo.repo}/blob/${context.sha}/${f})`)
if (body.length > 0) {
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "nbviewer URLs for impacted notebooks:\n\n" + body.join("\n")
})
}
14 changes: 14 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: pre-commit

on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
37 changes: 27 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
files: _shared_utils
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: end-of-file-fixer
- id: mixed-line-ending
- id: requirements-txt-fixer
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.37.0
- id: end-of-file-fixer
- id: check-yaml
args: ["--unsafe"]
- id: check-added-large-files
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
args: ["--ignore=E501,W503,F403,F405,E711,E712,E231,E702"]
# E711: comparison to None should be 'if cond is not None:' (siuba filtering requires we use != None and not is not)
# E712: line too long and line before binary operator (black is ok with these), assign lambda expression OK, comparison to True with is (siuba uses ==)
# E231: missing whitespace after colon (we don't want white space when setting gs://)
# E702: multiple statements on one line (semicolon)
types:
- python
files: _shared_utils
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
args: ["--line-length", "120"]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: markdownlint
- id: isort
args: ["--profile", "black", "--filter-files"]

0 comments on commit d5aaba5

Please sign in to comment.