-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(templates): Use Ruff to lint Cookiecutter templates
- Loading branch information
1 parent
662266a
commit ee1d664
Showing
24 changed files
with
206 additions
and
266 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pip==23.1.2 | ||
poetry==1.4.2 | ||
pre-commit==3.2.2 | ||
nox==2023.4.22 | ||
nox-poetry==1.0.2 |
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 |
---|---|---|
|
@@ -30,13 +30,18 @@ jobs: | |
- name: Check out the repository | ||
uses: actions/[email protected] | ||
|
||
- name: Install Poetry & Tox | ||
- name: Upgrade pip | ||
env: | ||
PIP_CONSTRAINT: .github/workflows/constraints.txt | ||
run: | | ||
pip install pip | ||
pip --version | ||
- name: Install Poetry | ||
run: | | ||
pipx install poetry | ||
poetry --version | ||
pipx install tox | ||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/[email protected] | ||
with: | ||
|
@@ -45,12 +50,10 @@ jobs: | |
cache: 'pip' | ||
cache-dependency-path: 'poetry.lock' | ||
|
||
- name: Upgrade pip | ||
env: | ||
PIP_CONSTRAINT: .github/workflows/constraints.txt | ||
- name: Install pre-commit | ||
run: | | ||
pip install pip | ||
pip --version | ||
pipx install pre-commit | ||
pre-commit --version | ||
- name: Install Nox | ||
env: | ||
|
@@ -63,6 +66,7 @@ jobs: | |
- name: Run Nox | ||
run: | | ||
nox --python=${{ matrix.python-version }} --session=test_cookiecutter | ||
- name: Upload build artifacts | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
|
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
36 changes: 36 additions & 0 deletions
36
cookiecutter/tap-template/{{cookiecutter.tap_id}}/.pre-commit-config.yaml
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,36 @@ | ||
ci: | ||
autofix_prs: true | ||
autoupdate_schedule: weekly | ||
autoupdate_commit_msg: 'chore: pre-commit autoupdate' | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: check-json | ||
- id: check-toml | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: v0.0.263 | ||
hooks: | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix] | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 23.3.0 | ||
hooks: | ||
- id: black | ||
|
||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.2.0 | ||
hooks: | ||
- id: mypy | ||
additional_dependencies: | ||
{%- if cookiecutter.stream_type == "SQL" %} | ||
- sqlalchemy-stubs | ||
{%- else %} | ||
- types-requests | ||
{%- endif %} |
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
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
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
Oops, something went wrong.