Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- id: changed-files
uses: tj-actions/changed-files@v47
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
with:
extra_args: --files ${{ steps.changed-files.outputs.all_changed_files }}
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
files: _shared_utils
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
Expand All @@ -12,7 +11,7 @@ repos:
rev: 7.3.0
hooks:
- id: flake8
args: ["--ignore=E501,W503,F403,F405,E711,E712,E231,E702,E203"]
args: ["--ignore=E501,W503,F403,F405,E711,E712,E231,E702,E203"]
# 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://)
Expand Down
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
# data-analyses
Place for sharing quick reports, and works in progress

This repository is for quick sharing of works in progress and simple analyses.
This repository is for quick sharing of works in progress and simple analyses.
For collaborative short-term tasks, create a new folder and work off a separate branch.
For longer-term projects, consider making a new repository!

## Using this Repo

* Use [this link](https://docs.calitp.org/data-infra/analytics_tools/saving_code.html#onboarding-setup) to get started in JupyterHub, set up SSH, and start commiting to the repo!

### Contributing
#### Pre-commit

This repository uses pre-commit hooks to format code, including [Black](https://black.readthedocs.io/en/stable/index.html). This ensures baseline consistency in code formatting.

> [!IMPORTANT]
> Before contributing to this project, please install pre-commit locally by running `pip install pre-commit` and `pre-commit install` in the root of the repo.

Once installed, pre-commit checks will run before you can make commits locally. If a pre-commit check fails, it will need to be addressed before you can make your commit. Many formatting issues are fixed automatically within the pre-commit actions, so check the changes made by pre-commit on failure -- they may have automatically addressed the issues that caused the failure, in which case you can simply re-add the files, re-attempt the commit, and the checks will then succeed.

Installing pre-commit locally saves time dealing with formatting issues on pull requests. There is a [GitHub Action](./.github/workflows/lint.yml)
that runs pre-commit on all files, not just changed ones, as part of our continuous integration.

## Quick Links - Get Started in Data Analysis

#### Data Analytics Documentation - Welcome
Expand Down