Skip to content

Commit 85b1534

Browse files
ops(dspy): activating pre-commit global check (and aligning to py3.9
1 parent 612bbfb commit 85b1534

File tree

3 files changed

+50
-3
lines changed

3 files changed

+50
-3
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Pre-commit checks
2+
on:
3+
pull_request:
4+
branches:
5+
- dev
6+
- main
7+
types:
8+
- opened
9+
- edited
10+
- synchronize
11+
workflow_dispatch:
12+
branches:
13+
- dev
14+
- main
15+
16+
jobs:
17+
pre-commit-checks:
18+
runs-on: [self-hosted, Linux, standard]
19+
steps:
20+
- uses: actions/checkout@v3
21+
- name: Set up Python
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: "3.9"
25+
cache: "pip"
26+
- name: Check Pull Request Title
27+
uses: Slashgear/action-check-pr-title@main
28+
with:
29+
regexp: '(break|build|ci|docs|feat|fix|perf|refactor|style|test|ops|hotfix|release|maint|init|enh|revert)\([a-z,A-Z,0-9,\-,\_,\/,:]+\)(:)\s{1}([\w\s]+)' # Regex the title should match.
30+
- name: Getting changed files list
31+
id: files
32+
uses: jitterbit/get-changed-files@master
33+
- name: Checking changed files
34+
shell: bash
35+
run: |
36+
echo "Changed files"
37+
echo ${{ steps.files.outputs.all }}
38+
echo "Github Client version"
39+
echo $(gh --version)
40+
- name: Pre-Commit Checks
41+
run: |
42+
python -m pip install --upgrade pip
43+
pip install pre-commit
44+
echo "Running pre-commit scans:"
45+
# adding log display in case of pre-commit errors
46+
pre-commit run -v --files ${{ steps.files.outputs.all }}
47+
shell: bash

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
default_language_version:
2-
python: python3.11
2+
python: python3.9
33

44
default_stages: [commit]
55
default_install_hook_types: [pre-commit, commit-msg]
@@ -22,7 +22,7 @@ repos:
2222
args:
2323
[
2424
"--profile=black",
25-
"--py=311",
25+
"--py=39",
2626
"--line-length=120",
2727
"--multi-line=3",
2828
"--trailing-comma",

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ exclude_lines = [
161161
[tool.ruff]
162162
line-length = 120
163163
indent-width = 4
164-
target-version = "py311"
164+
target-version = "py39"
165165
extend-unsafe-fixes = ["D"]
166166

167167
[tool.ruff.lint]

0 commit comments

Comments
 (0)