Skip to content

Commit

Permalink
Set up pre-commit (#37)
Browse files Browse the repository at this point in the history
* Rename CONTRIBUTING

* Add pre-commit
  • Loading branch information
g4brielvs authored Feb 9, 2024
1 parent 0852511 commit 36d1c5e
Show file tree
Hide file tree
Showing 23 changed files with 240 additions and 122 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1 @@
NASA_API_KEY = <YOUR_NASA_API_KEY>
NASA_API_KEY = <YOUR_NASA_API_KEY>
59 changes: 32 additions & 27 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
---
name: Bug report
about: Create a report to help us improve
name: Bug Report
about: Use to report a bug
title: ''
labels: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.
## Bug Report

### Description

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.

### Reproducibility

- [ ] The bug is reproducible.
- [ ] The bug is intermittent.
- [ ] The bug occurs only under specific conditions.

#### Steps to Reproduce

1. List the steps to reproduce the bug.
2. Be as detailed as possible to help with replication.

#### Screenshots / Error Messages (if applicable)

Insert any relevant screenshots or error messages related to the bug.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
#### Environment

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

**Screenshots**
If applicable, add screenshots to help explain your problem.
### Additional Context

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

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
### Possible Fix

**Additional context**
Add any other context about the problem here.
If you have suggestions for a fix, please describe them here.
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/peer_review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Peer Review
about: Use to submit a peer review
title: ''
labels: review
assignees: ''
---

## Peer Review for Reproducibility Checks

### Review Checklist

Please review the following aspects related to reproducibility checks:

- [ ] **Environment Setup**:
- [ ] Were detailed instructions provided for setting up the development environment?
- [ ] Are all necessary dependencies and libraries clearly documented?
- [ ] **Data Preparation**:
- [ ] Are source data files and preprocessing steps clearly documented?
- [ ] Are scripts or commands for data transformation included and well-documented?
- [ ] **Code Execution**:
- [ ] Were clear instructions provided for running the code?
- [ ] Does the code execute without errors and produce expected outputs?
- [ ] **Configuration Management**:
- [ ] Is version control information (e.g., Git commit hash) included for reproducibility?
- [ ] Are any configuration files or parameters used properly documented?
- [ ] **Results Verification**:
- [ ] Are output results (e.g., metrics, visualizations) included and matched with expected outcomes?
- [ ] Have any discrepancies between expected and actual results been identified and explained?
- [ ] **Documentation**:
- [ ] Is there a detailed README or documentation explaining the experiment setup and execution process?
- [ ] Are code comments and documentation clear and informative?
- [ ] **External Dependencies**:
- [ ] Are any external data sources or APIs used accessible and well-documented?
- [ ] Are external libraries or packages properly cited and versioned for reproducibility?
- [ ] **Validation**:
- [ ] Can an independent reviewer replicate the experiment using the provided instructions?
- [ ] Are the results consistent across different environments or platforms?

### Additional Comments

Include any additional comments, concerns, or suggestions related to reproducibility.
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ updates:
directory: "/docs"
schedule:
interval: "weekly"

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ target/
_build/

# python-dotenv
.env
.env
44 changes: 44 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-ast
- id: check-json
- id: detect-aws-credentials
args: [--allow-missing-credentials]
- id: detect-private-key
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.39.0
hooks:
- id: markdownlint
name: Markdownlint
files: \.(md|mdown|markdown)$
args: [
"--disable=MD013", # line-length
"--disable=MD033", # no-inline-html
]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
name: codespell
description: Checks for common misspellings in text files
exclude: >
(?x)^(
.*\.json|
)$
args: ["-L", "gost,"] # ignore words
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.1
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
args: [--fix]
- id: ruff-format
types_or: [python, pyi, jupyter]
45 changes: 0 additions & 45 deletions CONTRIBUTING.md

This file was deleted.

18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ The <span style="color:#3EACAD">template</span> is a standardized, but flexible

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:

- [**README**](README), [**CODE_OF_CONDUCT**](docs/CODE_OF_CONDUCT.md), [**CONTRIBUTING**](CONTRIBUTING.md) templates
- [**README**](README), [**CODE_OF_CONDUCT**](docs/CODE_OF_CONDUCT.md), [**CONTRIBUTING**](docs/CONTRIBUTING.md) templates
> README files are important and often neglected. The files should inform anyone about the first steps to use, learn and contribute to your project.
- **LICENSE**
> 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.
- **docs/**

> 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.
> 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.
- **docs/bibliography.bib**
> A `bibliography` using the [BibTeX](https://www.bibtex.org/Format/) format.
Expand Down Expand Up @@ -124,7 +124,7 @@ Please ensure you are logged in on [GitHub](https://github.com) and have permiss

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.

```
```yaml
repository:
url: https://github.com/worldbank/template
branch: main
Expand All @@ -149,7 +149,7 @@ Please ensure you are logged in on [GitHub](https://github.com) and have permiss

5. **Choose a license**

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.
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.

<hr>

Expand All @@ -171,7 +171,7 @@ When ready to publish the *documentation* on [GitHub Pages](https://pages.github

The <span style="color:#3EACAD">template</span> comes with the [table of contents](#table-of-contents) below as an example.

```
```yaml
format: jb-book
root: README
Expand Down Expand Up @@ -199,14 +199,14 @@ parts:

#### Dependencies

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

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.

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).

```
```yaml
channels:
- conda-forge
- defaults
Expand All @@ -220,7 +220,7 @@ dependencies:

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).

```
```shell
conda env create -n <your-environment-name> -f environment.yml
```

Expand Down
2 changes: 1 addition & 1 deletion _static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ a.current.reference.internal {

#pst-back-to-top {
background-color: #3eacad;
}
}
13 changes: 2 additions & 11 deletions docs/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,6 @@ the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org),
version 2.0. Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
Loading

0 comments on commit 36d1c5e

Please sign in to comment.