-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added pre-commit, reformatted all code.
- Loading branch information
1 parent
97d1b16
commit 83f6bfe
Showing
9 changed files
with
788 additions
and
264 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,69 @@ | ||
default_language_version: | ||
python: python3 | ||
exclude: 'dotnet' | ||
ci: | ||
autofix_prs: true | ||
autoupdate_commit_msg: '[pre-commit.ci] pre-commit suggestions' | ||
autoupdate_schedule: 'monthly' | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-ast | ||
- id: check-yaml | ||
- id: check-toml | ||
- id: check-json | ||
- id: check-byte-order-marker | ||
exclude: .gitignore | ||
- id: check-merge-conflict | ||
- id: detect-private-key | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: no-commit-to-branch | ||
- repo: https://github.com/psf/black | ||
rev: 24.3.0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.3.4 | ||
hooks: | ||
- id: ruff | ||
types_or: [ python, pyi, jupyter ] | ||
args: ["--fix", "--ignore=E402"] | ||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.2.6 | ||
hooks: | ||
- id: codespell | ||
args: ["-L", "ans,linar,nam,tread,ot,"] | ||
exclude: | | ||
(?x)^( | ||
pyproject.toml | | ||
website/static/img/ag.svg | | ||
website/yarn.lock | | ||
website/docs/tutorial/code-executors.ipynb | | ||
website/docs/topics/code-execution/custom-executor.ipynb | | ||
website/docs/topics/non-openai-models/cloud-gemini.ipynb | | ||
notebook/.* | ||
)$ | ||
# See https://jaredkhan.com/blog/mypy-pre-commit | ||
- repo: local | ||
hooks: | ||
- id: mypy | ||
name: mypy | ||
entry: "./scripts/pre-commit-mypy-run.sh" | ||
language: python | ||
# use your preferred Python version | ||
# language_version: python3.8 | ||
additional_dependencies: [] | ||
types: [python] | ||
# use require_serial so that script | ||
# is only called once per commit | ||
require_serial: true | ||
# Print the number of files as a sanity-check | ||
verbose: true | ||
- repo: https://github.com/nbQA-dev/nbQA | ||
rev: 1.8.5 | ||
hooks: | ||
- id: nbqa-black |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
requests>=2.28.1 | ||
requests>=2.28.1 |
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,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
# taken from: https://jaredkhan.com/blog/mypy-pre-commit | ||
|
||
# A script for running mypy, | ||
# with all its dependencies installed. | ||
|
||
set -o errexit | ||
|
||
# Change directory to the project root directory. | ||
cd "$(dirname "$0")"/.. | ||
|
||
pip install -q -e .[types] | ||
|
||
mypy |
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.