Skip to content

Commit 36d1c5e

Browse files
authored
Set up pre-commit (#37)
* Rename CONTRIBUTING * Add pre-commit
1 parent 0852511 commit 36d1c5e

23 files changed

+240
-122
lines changed

.env.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
NASA_API_KEY = <YOUR_NASA_API_KEY>
1+
NASA_API_KEY = <YOUR_NASA_API_KEY>

.github/ISSUE_TEMPLATE/bug_report.md

+32-27
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,43 @@
11
---
2-
name: Bug report
3-
about: Create a report to help us improve
2+
name: Bug Report
3+
about: Use to report a bug
44
title: ''
5-
labels: ''
5+
labels: bug
66
assignees: ''
7-
87
---
98

10-
**Describe the bug**
11-
A clear and concise description of what the bug is.
9+
## Bug Report
10+
11+
### Description
12+
13+
Provide a brief overview of the bug encountered. Describe the behavior observed when the bug occurs and explain the behavior expected when the bug is not present.
14+
15+
### Reproducibility
16+
17+
- [ ] The bug is reproducible.
18+
- [ ] The bug is intermittent.
19+
- [ ] The bug occurs only under specific conditions.
20+
21+
#### Steps to Reproduce
22+
23+
1. List the steps to reproduce the bug.
24+
2. Be as detailed as possible to help with replication.
25+
26+
#### Screenshots / Error Messages (if applicable)
27+
28+
Insert any relevant screenshots or error messages related to the bug.
1229

13-
**To Reproduce**
14-
Steps to reproduce the behavior:
15-
1. Go to '...'
16-
2. Click on '....'
17-
3. Scroll down to '....'
18-
4. See error
30+
#### Environment
1931

20-
**Expected behavior**
21-
A clear and concise description of what you expected to happen.
32+
- **Operating System**: [e.g., Windows 10, macOS, Linux]
33+
- **Browser (if applicable)**: [e.g., Google Chrome, Firefox, Safari]
34+
- **Application Version/Commit**: [e.g., v1.2.3, Git commit hash]
35+
- **Additional Environment Details**: [e.g., hardware specifications, network conditions]
2236

23-
**Screenshots**
24-
If applicable, add screenshots to help explain your problem.
37+
### Additional Context
2538

26-
**Desktop (please complete the following information):**
27-
- OS: [e.g. iOS]
28-
- Browser [e.g. chrome, safari]
29-
- Version [e.g. 22]
39+
Provide any additional context or information about the bug.
3040

31-
**Smartphone (please complete the following information):**
32-
- Device: [e.g. iPhone6]
33-
- OS: [e.g. iOS8.1]
34-
- Browser [e.g. stock browser, safari]
35-
- Version [e.g. 22]
41+
### Possible Fix
3642

37-
**Additional context**
38-
Add any other context about the problem here.
43+
If you have suggestions for a fix, please describe them here.

.github/ISSUE_TEMPLATE/peer_review.md

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: Peer Review
3+
about: Use to submit a peer review
4+
title: ''
5+
labels: review
6+
assignees: ''
7+
---
8+
9+
## Peer Review for Reproducibility Checks
10+
11+
### Review Checklist
12+
13+
Please review the following aspects related to reproducibility checks:
14+
15+
- [ ] **Environment Setup**:
16+
- [ ] Were detailed instructions provided for setting up the development environment?
17+
- [ ] Are all necessary dependencies and libraries clearly documented?
18+
- [ ] **Data Preparation**:
19+
- [ ] Are source data files and preprocessing steps clearly documented?
20+
- [ ] Are scripts or commands for data transformation included and well-documented?
21+
- [ ] **Code Execution**:
22+
- [ ] Were clear instructions provided for running the code?
23+
- [ ] Does the code execute without errors and produce expected outputs?
24+
- [ ] **Configuration Management**:
25+
- [ ] Is version control information (e.g., Git commit hash) included for reproducibility?
26+
- [ ] Are any configuration files or parameters used properly documented?
27+
- [ ] **Results Verification**:
28+
- [ ] Are output results (e.g., metrics, visualizations) included and matched with expected outcomes?
29+
- [ ] Have any discrepancies between expected and actual results been identified and explained?
30+
- [ ] **Documentation**:
31+
- [ ] Is there a detailed README or documentation explaining the experiment setup and execution process?
32+
- [ ] Are code comments and documentation clear and informative?
33+
- [ ] **External Dependencies**:
34+
- [ ] Are any external data sources or APIs used accessible and well-documented?
35+
- [ ] Are external libraries or packages properly cited and versioned for reproducibility?
36+
- [ ] **Validation**:
37+
- [ ] Can an independent reviewer replicate the experiment using the provided instructions?
38+
- [ ] Are the results consistent across different environments or platforms?
39+
40+
### Additional Comments
41+
42+
Include any additional comments, concerns, or suggestions related to reproducibility.

.github/dependabot.yml

-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ updates:
44
directory: "/docs"
55
schedule:
66
interval: "weekly"
7-

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,4 @@ target/
8989
_build/
9090

9191
# python-dotenv
92-
.env
92+
.env

.pre-commit-config.yaml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v3.2.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
- id: check-ast
12+
- id: check-json
13+
- id: detect-aws-credentials
14+
args: [--allow-missing-credentials]
15+
- id: detect-private-key
16+
- repo: https://github.com/igorshubovych/markdownlint-cli
17+
rev: v0.39.0
18+
hooks:
19+
- id: markdownlint
20+
name: Markdownlint
21+
files: \.(md|mdown|markdown)$
22+
args: [
23+
"--disable=MD013", # line-length
24+
"--disable=MD033", # no-inline-html
25+
]
26+
- repo: https://github.com/codespell-project/codespell
27+
rev: v2.2.4
28+
hooks:
29+
- id: codespell
30+
name: codespell
31+
description: Checks for common misspellings in text files
32+
exclude: >
33+
(?x)^(
34+
.*\.json|
35+
)$
36+
args: ["-L", "gost,"] # ignore words
37+
- repo: https://github.com/astral-sh/ruff-pre-commit
38+
rev: v0.2.1
39+
hooks:
40+
- id: ruff
41+
types_or: [python, pyi, jupyter]
42+
args: [--fix]
43+
- id: ruff-format
44+
types_or: [python, pyi, jupyter]

CONTRIBUTING.md

-45
This file was deleted.

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ The <span style="color:#3EACAD">template</span> is a standardized, but flexible
44

55
Inspired by [literate programming](http://literateprogramming.com), maintained by the [Development Data Group](https://www.worldbank.org/en/about/unit/unit-dec/dev) and built as [GitHub template repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template), the <span style="color:#3EACAD">template</span> contains:
66

7-
- [**README**](README), [**CODE_OF_CONDUCT**](docs/CODE_OF_CONDUCT.md), [**CONTRIBUTING**](CONTRIBUTING.md) templates
7+
- [**README**](README), [**CODE_OF_CONDUCT**](docs/CODE_OF_CONDUCT.md), [**CONTRIBUTING**](docs/CONTRIBUTING.md) templates
88
> README files are important and often neglected. The files should inform anyone about the first steps to use, learn and contribute to your project.
99
1010
- **LICENSE**
1111
> The LICENSE is a document that determines what others can and cannot do with contents of the repository. If no license is present, no one has permission to use and/or modify your code. The <span style="color:#3EACAD">template</span> is licensed under the [**Mozilla Public License**](https://www.mozilla.org/en-US/MPL/). And so will projects generated from it.
1212
1313
- **docs/**
1414

15-
> Documentation is often never priotized until last minute. The <span style="color:#3EACAD">template</span> aims to revert the malpractice by setting up the documentation as an integral part, inspired by [literate programming](http://literateprogramming.com). With the power of [Jupyter Book](https://jupyterbook.org), data practioners have a way to share [Jupyter notebooks](https://jupyter.org) on [GitHub Pages](https://pages.github.com) in a standardized and effortless way.
15+
> Documentation is often never prioritized until last minute. The <span style="color:#3EACAD">template</span> aims to revert the malpractice by setting up the documentation as an integral part, inspired by [literate programming](http://literateprogramming.com). With the power of [Jupyter Book](https://jupyterbook.org), data practitioners have a way to share [Jupyter notebooks](https://jupyter.org) on [GitHub Pages](https://pages.github.com) in a standardized and effortless way.
1616
1717
- **docs/bibliography.bib**
1818
> A `bibliography` using the [BibTeX](https://www.bibtex.org/Format/) format.
@@ -124,7 +124,7 @@ Please ensure you are logged in on [GitHub](https://github.com) and have permiss
124124
125125
The <span style="color:#3EACAD">template</span> comes with a default `docs/_config.yml` Jupyter Book configuration file. Remember to update it to reflect your project's name and details.
126126
127-
```
127+
```yaml
128128
repository:
129129
url: https://github.com/worldbank/template
130130
branch: main
@@ -149,7 +149,7 @@ Please ensure you are logged in on [GitHub](https://github.com) and have permiss
149149
150150
5. **Choose a license**
151151
152-
The <span style="color:#3EACAD">template</span> is licensed under the [**World Bank Master Community License Agreement**](LICENSE). A LICENSE is the document that guarantees the repository can be shared, modified and receive contributions. Otherwise, if no license is present, all rights are reserved.
152+
The <span style="color:#3EACAD">template</span> is licensed under the [**Mozilla Public License**](https://www.mozilla.org/en-US/MPL). A LICENSE is the document that guarantees the repository can be shared, modified and receive contributions. Otherwise, if no license is present, all rights are reserved.
153153
154154
<hr>
155155
@@ -171,7 +171,7 @@ When ready to publish the *documentation* on [GitHub Pages](https://pages.github
171171
172172
The <span style="color:#3EACAD">template</span> comes with the [table of contents](#table-of-contents) below as an example.
173173
174-
```
174+
```yaml
175175
176176
format: jb-book
177177
root: README
@@ -199,14 +199,14 @@ parts:
199199

200200
#### Dependencies
201201

202-
The next step is ensure your code is maintainable, realiable and reproducible by including
203-
any dependencies and requirements, such as packages, configurations, secrets (template) and addtional instructions.
202+
The next step is ensure your code is maintainable, reliable and reproducible by including
203+
any dependencies and requirements, such as packages, configurations, secrets (template) and additional instructions.
204204

205205
The <span style="color:#3EACAD">template</span> suggests to use [conda](https://docs.conda.io/) (or [mamba](https://mamba.readthedocs.io/en/latest/)) as environment manager and, as [conventional](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html), the environment is controlled by the `environment.yml` file.
206206

207207
The `environment.yml` file is where you specify any packages available on the [Anaconda repository](https://anaconda.org) as well as from the Anaconda Cloud (including [conda-forge](https://conda-forge.org)) to install for your project. Ensure to include the pinned version of packages required by your project (including by Jupyter notebooks).
208208

209-
```
209+
```yaml
210210
channels:
211211
- conda-forge
212212
- defaults
@@ -220,7 +220,7 @@ dependencies:
220220
221221
To (re)create the environment on your installation of [conda](https://conda.io) via [anaconda](https://docs.anaconda.com/anaconda/install/), [miniconda](https://docs.conda.io/projects/continuumio-conda/en/latest/user-guide/install/) or preferably [miniforge](https://github.com/conda-forge/miniforge), you only need to pass the `environment.yml` file, which will install requirements and guarantee that whoever uses your code has the necessary packages (and correct versions). By default, the <span style="color:#3EACAD">template</span> uses [Python 3.9](https://www.python.org).
222222

223-
```
223+
```shell
224224
conda env create -n <your-environment-name> -f environment.yml
225225
```
226226

_static/custom.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ a.current.reference.internal {
4545

4646
#pst-back-to-top {
4747
background-color: #3eacad;
48-
}
48+
}

docs/CODE_OF_CONDUCT.md

+2-11
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,6 @@ the community.
114114

115115
## Attribution
116116

117-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118-
version 2.0, available at
119-
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120-
121-
Community Impact Guidelines were inspired by [Mozilla's code of conduct
117+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org),
118+
version 2.0. Community Impact Guidelines were inspired by [Mozilla's code of conduct
122119
enforcement ladder](https://github.com/mozilla/diversity).
123-
124-
[homepage]: https://www.contributor-covenant.org
125-
126-
For answers to common questions about this code of conduct, see the FAQ at
127-
https://www.contributor-covenant.org/faq. Translations are available at
128-
https://www.contributor-covenant.org/translations.

0 commit comments

Comments
 (0)