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
122 changes: 73 additions & 49 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,50 @@
# Basic .gitattributes for a python repo.

# Source files
# ============
*.pxd text diff=python
*.py text diff=python
*.py3 text diff=python
*.pyw text diff=python
*.pyx text diff=python
*.pyz text diff=python
*.pyi text diff=python

# Binary files
# ============
*.db binary
*.p binary
*.pkl binary
*.pickle binary
*.pyc binary export-ignore
*.pyo binary export-ignore
*.pyd binary

# Jupyter notebook
*.ipynb text eol=lf

# Note: .db, .p, and .pkl files are associated
# with the python modules ``pickle``, ``dbm.*``,
# ``shelve``, ``marshal``, ``anydbm``, & ``bsddb``
# (among others).

# Basic .gitattributes for a R repo.

# Source files
# ============
*.Rdata binary
*.RData binary
*.rda binary
*.rdb binary
*.rds binary
*.Rd text
*.Rdx binary
*.Rmd text
*.R text
*.Rproj text
*.[Rr]md linguist-detectable

# Common settings that generally should always be used with your language specific settings
# generated by https://www.richie-bendall.ml/gitattributes-generator/

# Auto detect text files and perform LF normalization
* text=auto
Expand All @@ -26,7 +71,7 @@
*.adoc text
*.textile text
*.mustache text
*.csv text
*.csv text eol=crlf
*.tab text
*.tsv text
*.txt text
Expand All @@ -51,6 +96,7 @@
# Scripts
*.bash text eol=lf
*.fish text eol=lf
*.ksh text eol=lf
*.sh text eol=lf
*.zsh text eol=lf
# These are explicitly windows files and should use crlf
Expand All @@ -67,10 +113,24 @@

# Archives
*.7z binary
*.bz binary
*.bz2 binary
*.bzip2 binary
*.gz binary
*.lz binary
*.lzma binary
*.rar binary
*.tar binary
*.taz binary
*.tbz binary
*.tbz2 binary
*.tgz binary
*.tlz binary
*.txz binary
*.xz binary
*.Z binary
*.zip binary
*.zst binary

# Text files where line endings should be preserved
*.patch -text
Expand All @@ -86,52 +146,6 @@
# Apply override to all files in the directory
*.md linguist-detectable

# Basic .gitattributes for a python repo.

# Source files
# ============
*.pxd text diff=python
*.py text diff=python
*.py3 text diff=python
*.pyw text diff=python
*.pyx text diff=python
*.pyz text diff=python
*.pyi text diff=python

# Binary files
# ============
*.db binary
*.p binary
*.pkl binary
*.pickle binary
*.pyc binary export-ignore
*.pyo binary export-ignore
*.pyd binary

# Jupyter notebook
*.ipynb text eol=lf

# Note: .db, .p, and .pkl files are associated
# with the python modules ``pickle``, ``dbm.*``,
# ``shelve``, ``marshal``, ``anydbm``, & ``bsddb``
# (among others).

# Basic .gitattributes for a R repo.

# Source files
# ============
*.Rdata binary
*.RData binary
*.rda binary
*.rdb binary
*.rds binary
*.Rd text
*.Rdx binary
*.Rmd text
*.R text
*.Rproj text
*.[Rr]md linguist-detectable

## GITATTRIBUTES FOR WEB PROJECTS
#
# These settings are for any web project.
Expand Down Expand Up @@ -160,6 +174,8 @@
*.inc text
*.ini text
*.js text
*.mjs text
*.cjs text
*.json text
*.jsx text
*.less text
Expand Down Expand Up @@ -238,7 +254,7 @@ TODO text
*.conf text
*.config text
.editorconfig text
.env text
*.env text
.gitattributes text
.gitconfig text
.htaccess text
Expand All @@ -254,6 +270,8 @@ yarn.lock text -diff
browserslist text
Makefile text
makefile text
# Fixes syntax highlighting on GitHub to allow comments
tsconfig.json linguist-language=JSON-with-Comments

# Heroku
Procfile text
Expand Down Expand Up @@ -333,9 +351,15 @@ Procfile text
# Executables
*.exe binary
*.pyc binary
# Prevents massive diffs caused by vendored, minified files
**/.yarn/releases/** binary
**/.yarn/plugins/** binary

# RC files (like .babelrc or .eslintrc)
*.*rc text

# Ignore files (like .npmignore or .gitignore)
*.*ignore text

# Prevents massive diffs from built files
dist/** binary
1 change: 0 additions & 1 deletion .husky/pre-commit

This file was deleted.

14 changes: 12 additions & 2 deletions .lycheerc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@
# https://lychee.cli.rs/configuration/

# Exclude template placeholders from link checking
exclude = ["USERNAME", "REPO_NAME", "ZENODO_RECORD", "GITHUB_REPO_ID", "FULLNAME", "\\[INSERT CONTACT METHOD\\]"]
exclude = [
"USERNAME",
"REPO_NAME",
"ZENODO_RECORD",
"GITHUB_REPO_ID",
"FULLNAME",
"\\[INSERT CONTACT METHOD\\]",
"https://www.gnu.org/licenses/",
"https://www.gnu.org/licenses/agpl-3.0.html",
"https://www.makeareadme.com/",
]

# Timeout for requests (seconds)
timeout = 10
Expand All @@ -23,4 +33,4 @@ cache = true
max_cache_age = "7d"

# Accept status codes: 100-103 (informational), 200-299 (success), 429 (rate limit), 503 (unavailable) as non-blocking
accept = ["100..=103", "200..=299", "429", "503"]
accept = ["100..=103", "200..=299", "429", "503", "521", "522", "524"]
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
repos:
- repo: local
hooks:
- id: prettier-check
name: Prettier check
entry: npm run check
language: system
stages: [pre-commit]
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Place new files accordingly.

1. `npm install <package>`
2. Commit `package.json` and `package-lock.json`
3. If needed: `npm run prepare` to reinit Husky hooks
3. If needed: `npm run prepare` to install Prek git hooks

### Python (uv)

Expand Down Expand Up @@ -150,7 +150,7 @@ Place new files accordingly.
| `lintr::lint_dir(".")` | Lint R code |
| `npm run commit` | Conventional Commits wizard |
| `npm run changelog` | Generate changelog from commits |
| `npm run prepare` | Setup Husky git hooks |
| `npm run prepare` | Setup Prek git hooks |
| `uv sync` | Sync Python dependencies |
| `renv::restore()` | Restore R environment |
| `quarto render` | **Production render** (avoid in agent sessions) |
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Please note we have a [code of conduct](CODE_OF_CONDUCT.md), please follow it in
3. Ensure all code is properly formatted and linted:
- Run `npm run format` to format general files with Prettier
- Run `npm run check` to verify formatting
- Install Prek hooks with `npm run prepare`
- Run `prek run --all-files` to run all hooks locally (or `npx @j178/prek run --all-files` if Prek isn't installed globally)
- Run `uv run ruff format` to format Python code
- Run `uv run ruff check` to lint Python code
- Run `uv run ty check` to type check Python code (if applicable)
Expand Down
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Conventional data publication as static supplementary files offers limited repro
- Python type checking with [ty](https://github.com/astral-sh/ty)
- Python dependency management with [uv](https://github.com/astral-sh/uv)
- R dependency management with [renv](https://rstudio.github.io/renv/)
- Commit messages following [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) enforced via [husky](https://github.com/typicode/husky)
- Commit messages following [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) enforced via [prek](https://prek.j178.dev/)
- Versioning following [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
- Workflow based on [fork and pull](https://gist.github.com/Chaser324/ce0505fbed06b947d962) with [GitHub branch protection](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/managing-a-branch-protection-rule)
- Issue tracking via [issue templates](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository)
Expand Down Expand Up @@ -109,6 +109,27 @@ We recommend using **[GitHub Codespaces](https://github.com/features/codespaces)

## Getting Started

### Prek Git Hooks

This template uses [Prek](https://prek.j178.dev/) for managing Git hooks with a pre-commit-compatible configuration. To install hooks locally:

```bash
npm install
npm run prepare
```

To run all hooks on demand:

```bash
prek run --all-files
```

If Prek is not installed globally, you can run:

```bash
npx @j178/prek run --all-files
```

### For Most Users: Reproducible Setup with GitHub Codespaces

1. **[Use this template](https://github.com/new?template_name=open-research-data-template&template_owner=maehr)** for your project in a new repository on your GitHub account.
Expand Down
Loading
Loading