-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
187 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[flake8] | ||
max-line-length = 120 | ||
ignore = E731,E721,W503 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
name: pre-commit action | ||
on: | ||
pull_request: | ||
# Run on merge to main because caches are inherited from parent branches | ||
push: | ||
branches: | ||
- main | ||
env: | ||
# This should be the default but we'll be explicit | ||
PRE_COMMIT_HOME: ~/.caches/pre-commit | ||
jobs: | ||
the_job: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python_version: ['3.10'] | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python_version }} | ||
- name: Bootstrap poetry | ||
shell: bash | ||
run: | | ||
python -m ensurepip | ||
python -m pip install --upgrade pip | ||
python -m pip install poetry | ||
- name: Configure poetry | ||
shell: bash | ||
run: | | ||
python -m poetry config virtualenvs.in-project true | ||
- name: Cache Poetry dependencies | ||
uses: actions/cache@v3 | ||
id: poetry-cache | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ matrix.python_version }}-${{ hashFiles('poetry.lock') }} | ||
- name: Install dependencies | ||
shell: bash | ||
if: steps.poetry-cache.outputs.cache-hit != 'true' | ||
run: | | ||
python -m poetry install | ||
- name: Install Pre-Commit | ||
shell: bash | ||
run: | | ||
python -m pip install pre-commit | ||
- name: Cache Pre-Commit Hooks | ||
id: pre-commit-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.PRE_COMMIT_HOME }} | ||
key: hooks-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }} | ||
- name: Install Pre-Commit Hooks | ||
shell: bash | ||
if: steps.pre-commit-cache.outputs.cache-hit != 'true' | ||
run: | | ||
pre-commit install-hooks | ||
- name: Run Pre-Commit Hooks | ||
shell: bash | ||
run: | | ||
pre-commit run --all-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,4 +116,4 @@ dmypy.json | |
.pyre/ | ||
|
||
# Pycharm | ||
.idea/ | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
# 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: v4.2.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
- repo: https://github.com/markdownlint/markdownlint | ||
rev: v0.11.0 | ||
hooks: | ||
- id: markdownlint | ||
args: [--style=mdl_style.rb] | ||
- repo: https://github.com/psf/black | ||
rev: 22.10.0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.10.1 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 6.0.0 | ||
hooks: | ||
- id: flake8 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
all | ||
exclude_rule 'MD013' | ||
exclude_rule 'MD026' | ||
rule 'MD029', :style => :one |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.