Skip to content

Commit

Permalink
Set up pre-commit (#56)
Browse files Browse the repository at this point in the history
* Add pre-commit

* Add GA
  • Loading branch information
g4brielvs authored Feb 12, 2024
1 parent 4fc7be1 commit aeb873b
Show file tree
Hide file tree
Showing 16 changed files with 133 additions and 287 deletions.
54 changes: 33 additions & 21 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,43 @@
---
name: Bug report
about: Create a report to help us improve
name: Bug Report
about: Use to report a bug
title: ''
labels: bug, help wanted
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.

#### Environment

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
- **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]

**Expected behavior**
A clear and concise description of what you expected to happen.
### Additional Context

**Screenshots**
If applicable, add screenshots to help explain your problem.
Provide any additional context or information about the bug.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- 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.
20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

39 changes: 27 additions & 12 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
### Summary :memo:
_Write an overview about it._
# Pull Request Template

### Details
_Describe more what you did on changes._
1. (...)
2. (...)
## Description

### Bugfixes :bug: (delete if dind't have any)
-
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

### Checks
- [ ] Closed #798
- [ ] Tested Changes
- [ ] Stakeholder Approval
Fixes #(issue)

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update

## Checklist

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes

## Screenshots (if appropriate)

## Additional context

Add any other context about the pull request here.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "monthly"
interval: "monthly"
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: tests

on:
push:
branches:
branches:
- "main"
pull_request:
branches:
Expand Down Expand Up @@ -33,4 +33,4 @@ jobs:
continue-on-error: true
- name: Test with pytest
run: |
pytest
pytest
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ node_modules
# Documentation
_build/

# Data
# Project-specific
.jupyter/
*.tif
*.h5
*.h5
45 changes: 45 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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.
entry: codespell --skip="*.js,*.html,*.css, *.svg"
exclude: |
(?x)^(
examples/blackmarblepy.ipynb|
examples/quality-assessment.ipynb|
)$
- 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]
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ pip install blackmarblepy

The `-e` flag stands for "editable," meaning changes to the source code will immediately affect the installed package.

### Bulding Documentation Locally
this is a fds

### Building Documentation Locally

To build the documentation locally, after (1) and (2) above, please follow these steps:

Expand Down
8 changes: 4 additions & 4 deletions docs/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ representative at an online or offline event.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
github@worldbank.org.
<github@worldbank.org>.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
Expand Down Expand Up @@ -116,13 +116,13 @@ the community.

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.
<https://www.contributor-covenant.org/version/2/0/code_of_conduct.html>.

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.
<https://www.contributor-covenant.org/faq>. Translations are available at
<https://www.contributor-covenant.org/translations>.
5 changes: 3 additions & 2 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Book settings
title:
author: World Bank Development Data Group
author: Development Data Group
logo: images/logo.png
only_build_toc_files: true

Expand All @@ -18,11 +18,12 @@ html:
use_issues_button: true
baseurl: https://worldbank.github.io/blackmarblepy
html_favicon: "images/favicon.ico"
google_analytics_id: G-ZWF69GP65G

#######################################################################################
# Execution settings
execute:
execute_notebooks: "off"
execute_notebooks: off

#######################################################################################
# Bibliography settings
Expand Down
Loading

0 comments on commit aeb873b

Please sign in to comment.