Skip to content

Commit 288e22c

Browse files
authored
INTPYTHON-428 Add pre-commit config to langchain-mongodb (#18)
1 parent 10f8aa9 commit 288e22c

File tree

8 files changed

+122
-79
lines changed

8 files changed

+122
-79
lines changed

.github/workflows/_release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ on:
1111
inputs:
1212
working-directory:
1313
required: true
14+
type: choice
1415
options:
1516
- libs/mongodb
1617
- langgraph-checkpoint-mongodb
1718
default: libs/mongodb
19+
description: "From which folder this pipeline executes"
1820

1921
env:
2022
PYTHON_VERSION: "3.11"
@@ -114,7 +116,7 @@ jobs:
114116
PKG_NAME: ${{ needs.build.outputs.pkg-name }}
115117
VERSION: ${{ needs.build.outputs.version }}
116118
# Here we use:
117-
# - The default regular PyPI index as the *primary* index, meaning
119+
# - The default regular PyPI index as the *primary* index, meaning
118120
# that it takes priority (https://pypi.org/simple)
119121
# - The test PyPI index as an extra index, so that any dependencies that
120122
# are not found on test PyPI can be resolved and installed anyway.

.github/workflows/ci.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ jobs:
3535
outputs:
3636
dirs-to-lint: ${{ steps.set-matrix.outputs.dirs-to-lint }}
3737
dirs-to-test: ${{ steps.set-matrix.outputs.dirs-to-test }}
38+
pre-commit:
39+
name: pre-commit
40+
runs-on: ubuntu-latest
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
with:
45+
persist-credentials: false
46+
- uses: actions/setup-python@v5
47+
- uses: pre-commit/[email protected]
48+
with:
49+
extra_args: --all-files --hook-stage=manual
3850
lint:
3951
name: cd ${{ matrix.working-directory }}
4052
needs: [ build ]
@@ -61,7 +73,7 @@ jobs:
6173

6274
ci_success:
6375
name: "CI Success"
64-
needs: [build, lint, test]
76+
needs: [build, lint, test, pre-commit]
6577
if: |
6678
always()
6779
runs-on: ubuntu-latest

.pre-commit-config.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.5.0
5+
hooks:
6+
- id: check-added-large-files
7+
- id: check-case-conflict
8+
- id: check-toml
9+
- id: check-yaml
10+
- id: debug-statements
11+
- id: end-of-file-fixer
12+
- id: forbid-new-submodules
13+
- id: trailing-whitespace
14+
exclude_types: [json]
15+
16+
# We use the Python version instead of the original version which seems to require Docker
17+
# https://github.com/koalaman/shellcheck-precommit
18+
- repo: https://github.com/shellcheck-py/shellcheck-py
19+
rev: v0.9.0.6
20+
hooks:
21+
- id: shellcheck
22+
name: shellcheck
23+
args: ["--severity=warning"]
24+
stages: [manual]
25+
26+
- repo: https://github.com/sirosen/check-jsonschema
27+
rev: 0.29.4
28+
hooks:
29+
- id: check-github-workflows
30+
args: ["--verbose"]

libs/langgraph-checkpoint-mongodb/pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,3 @@ warn_unused_ignores = "True"
6666
warn_redundant_casts = "True"
6767
allow_redefinition = "True"
6868
disable_error_code = "typeddict-item, return-value"
69-

0 commit comments

Comments
 (0)