From 08042932c34d6c4edf35643d48ed2e3e3061c6eb Mon Sep 17 00:00:00 2001 From: Colton Loftus <70598503+C-Loftus@users.noreply.github.com> Date: Thu, 27 Jun 2024 12:51:01 -0400 Subject: [PATCH 1/6] pre-commit config --- .pre-commit-config.yaml | 48 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..e7f9d67 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,48 @@ +minimum_pre_commit_version: "2.9.0" +ci: + autoupdate_schedule: monthly +repos: + - repo: meta + hooks: + - id: check-hooks-apply + - 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-added-large-files + - 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 + rev: v0.4.1 + hooks: + - id: ruff + args: [--fix, --exit-non-zero-on-fix] + - id: ruff-format \ No newline at end of file From 9d6deffab690b2783b3cb687245ef7ec0c3f2291 Mon Sep 17 00:00:00 2001 From: Colton Loftus <70598503+C-Loftus@users.noreply.github.com> Date: Thu, 27 Jun 2024 12:56:11 -0400 Subject: [PATCH 2/6] support ipynb --- .pre-commit-config.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e7f9d67..f1e29cb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,8 +41,13 @@ repos: hooks: - id: flynt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.1 + # Ruff version. + rev: v0.5.0 hooks: + # Run the linter. - id: ruff - args: [--fix, --exit-non-zero-on-fix] - - id: ruff-format \ No newline at end of file + types_or: [ python, pyi, jupyter ] + args: [ --fix ] + # Run the formatter. + - id: ruff-format + types_or: [ python, pyi, jupyter ] \ No newline at end of file From 848c231ff4ef76f157411cc924d948f77b8a6c08 Mon Sep 17 00:00:00 2001 From: Colton <70598503+C-Loftus@users.noreply.github.com> Date: Fri, 28 Jun 2024 12:21:56 -0400 Subject: [PATCH 3/6] Remove large file check since this might fail on a geoconnex upload --- .pre-commit-config.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f1e29cb..e99c299 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,7 +20,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 hooks: - - id: check-added-large-files - id: check-case-conflict - id: check-executables-have-shebangs - id: check-merge-conflict From ebe8e72d9df5a29cf68da7c839d2626264f7e3f5 Mon Sep 17 00:00:00 2001 From: Colton Loftus <70598503+C-Loftus@users.noreply.github.com> Date: Tue, 2 Jul 2024 09:14:42 -0400 Subject: [PATCH 4/6] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e99c299..e2b016d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,6 @@ ci: repos: - repo: meta hooks: - - id: check-hooks-apply - id: check-useless-excludes - repo: local hooks: @@ -49,4 +48,4 @@ repos: args: [ --fix ] # Run the formatter. - id: ruff-format - types_or: [ python, pyi, jupyter ] \ No newline at end of file + types_or: [ python, pyi, jupyter ] From 6ebf2dd001fdd7df4e4d560cb4f6be03b1b6fa00 Mon Sep 17 00:00:00 2001 From: Colton Loftus <70598503+C-Loftus@users.noreply.github.com> Date: Tue, 2 Jul 2024 12:45:26 -0400 Subject: [PATCH 5/6] nbstrip --- .pre-commit-config.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e2b016d..6893622 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -44,8 +44,14 @@ repos: hooks: # Run the linter. - id: ruff - types_or: [ python, pyi, jupyter ] - args: [ --fix ] + types_or: [python, pyi, jupyter] + args: [--fix] # Run the formatter. - id: ruff-format - types_or: [ python, pyi, jupyter ] + 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 From 32dccba696e0439a3bf97ed0c8fbadeb7cd8d39a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Jul 2024 16:45:34 +0000 Subject: [PATCH 6/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/ISSUE_TEMPLATE/bug_report.md | 13 ++++--- .github/ISSUE_TEMPLATE/documentation_issue.md | 5 ++- .github/ISSUE_TEMPLATE/feature_request.md | 6 ++-- .github/pull_request_template.md | 4 +++ .github/workflows/flake8.yml | 34 +++++++++---------- README.md | 1 + 6 files changed, 32 insertions(+), 31 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 3671b97..b2bf433 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -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. @@ -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. diff --git a/.github/ISSUE_TEMPLATE/documentation_issue.md b/.github/ISSUE_TEMPLATE/documentation_issue.md index 109cbf0..ab69dee 100644 --- a/.github/ISSUE_TEMPLATE/documentation_issue.md +++ b/.github/ISSUE_TEMPLATE/documentation_issue.md @@ -1,10 +1,9 @@ --- name: Documentation issue about: Create a report to improve documenation -title: '' +title: "" labels: documentation -assignees: '' - +assignees: "" --- **Description** diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 229493e..d883b8f 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -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 [...] diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 99272cc..f353a3a 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,11 +1,15 @@ # Description + # Changes Made + # Related Issues + # Additional Notes + diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index 57d66ff..e6ec55b 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -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 diff --git a/README.md b/README.md index 1661fa2..3c7865e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # CGS Repository Template + Template repository for all CGS GitHub repositories