Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precommit CI Integration #10

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
13 changes: 6 additions & 7 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
title: ""
labels: bug
assignees: ''

assignees: ""
---


**Description**
A clear and concise description of what the bug is.

Expand All @@ -21,9 +19,10 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Environment**
- OS:
- Python version:
- Python env/venv:

- OS:
- Python version:
- Python env/venv:

**Additional context**
Add any other context about the problem here.
5 changes: 2 additions & 3 deletions .github/ISSUE_TEMPLATE/documentation_issue.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Documentation issue
about: Create a report to improve documenation
title: ''
title: ""
labels: documentation
assignees: ''

assignees: ""
---

**Description**
Expand Down
6 changes: 2 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
title: ""
labels: enhancement
assignees: ''

assignees: ""
---


**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Expand Down
4 changes: 4 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# Description

<!-- Describe the purpose of this pull request -->

# Changes Made

<!-- Provide a brief overview of the changes implemented in this pull request -->

# Related Issues

<!-- If this pull request resolves any GitHub issues, reference them here -->

# Additional Notes

<!-- Any additional information or context about the pull request -->
34 changes: 17 additions & 17 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
name: flake8 ⚙️

on: [ push, pull_request ]
on: [push, pull_request]

jobs:
main:
runs-on: ubuntu-latest

steps:
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.8
architecture: x64
- name: Checkout repository
uses: actions/checkout@master
- name: Install flake8
run: pip install flake8 flake8-nb
- name: run flake8 ⚙️
run: |
find . -type f -name "*.py" | xargs flake8
- name: run flake8-notebook ⚙️
if: '!cancelled()'
run: |
find . -type f -name "*.ipynb" | xargs flake8-nb
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.8
architecture: x64
- name: Checkout repository
uses: actions/checkout@master
- name: Install flake8
run: pip install flake8 flake8-nb
- name: run flake8 ⚙️
run: |
find . -type f -name "*.py" | xargs flake8
- name: run flake8-notebook ⚙️
if: "!cancelled()"
run: |
find . -type f -name "*.ipynb" | xargs flake8-nb
57 changes: 57 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
minimum_pre_commit_version: "2.9.0"
ci:
autoupdate_schedule: monthly
repos:
- repo: meta
hooks:
- id: check-useless-excludes
- repo: local
hooks:
- id: forbid-symlinks
name: Forbid symlinks
entry: Forbid symlinks
language: fail
types: [symlink]
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.1
hooks:
- id: forbid-crlf
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
exclude_types: [svg]
- id: fix-byte-order-marker
- id: mixed-line-ending

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v4.0.0-alpha.8"
hooks:
- id: prettier
- repo: https://github.com/ikamensh/flynt
rev: "1.0.1"
hooks:
- id: flynt
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.5.0
hooks:
# Run the linter.
- id: ruff
types_or: [python, pyi, jupyter]
args: [--fix]
# Run the formatter.
- id: ruff-format
types_or: [python, pyi, jupyter]
# Remove stale jupyter notebook outputs
# For extra options see https://github.com/kynan/nbstripout?tab=readme-ov-file#configuration-files
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
hooks:
- id: nbstripout
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# CGS Repository Template

Template repository for all CGS GitHub repositories