Skip to content

Commit

Permalink
INTPYTHON-428 Add pre-commit config to langchain-mongodb (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Nov 22, 2024
1 parent 10f8aa9 commit 288e22c
Show file tree
Hide file tree
Showing 8 changed files with 122 additions and 79 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ on:
inputs:
working-directory:
required: true
type: choice
options:
- libs/mongodb
- langgraph-checkpoint-mongodb
default: libs/mongodb
description: "From which folder this pipeline executes"

env:
PYTHON_VERSION: "3.11"
Expand Down Expand Up @@ -114,7 +116,7 @@ jobs:
PKG_NAME: ${{ needs.build.outputs.pkg-name }}
VERSION: ${{ needs.build.outputs.version }}
# Here we use:
# - The default regular PyPI index as the *primary* index, meaning
# - The default regular PyPI index as the *primary* index, meaning
# that it takes priority (https://pypi.org/simple)
# - The test PyPI index as an extra index, so that any dependencies that
# are not found on test PyPI can be resolved and installed anyway.
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ jobs:
outputs:
dirs-to-lint: ${{ steps.set-matrix.outputs.dirs-to-lint }}
dirs-to-test: ${{ steps.set-matrix.outputs.dirs-to-test }}
pre-commit:
name: pre-commit
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-python@v5
- uses: pre-commit/[email protected]
with:
extra_args: --all-files --hook-stage=manual
lint:
name: cd ${{ matrix.working-directory }}
needs: [ build ]
Expand All @@ -61,7 +73,7 @@ jobs:

ci_success:
name: "CI Success"
needs: [build, lint, test]
needs: [build, lint, test, pre-commit]
if: |
always()
runs-on: ubuntu-latest
Expand Down
30 changes: 30 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: forbid-new-submodules
- id: trailing-whitespace
exclude_types: [json]

# We use the Python version instead of the original version which seems to require Docker
# https://github.com/koalaman/shellcheck-precommit
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
hooks:
- id: shellcheck
name: shellcheck
args: ["--severity=warning"]
stages: [manual]

- repo: https://github.com/sirosen/check-jsonschema
rev: 0.29.4
hooks:
- id: check-github-workflows
args: ["--verbose"]
1 change: 0 additions & 1 deletion libs/langgraph-checkpoint-mongodb/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,3 @@ warn_unused_ignores = "True"
warn_redundant_casts = "True"
allow_redefinition = "True"
disable_error_code = "typeddict-item, return-value"

Loading

0 comments on commit 288e22c

Please sign in to comment.