Skip to content

Commit 4ef8fd3

Browse files
authored
pre-commit github workflow (#39)
* pre-commit github workflow * rebased for github action to pass
1 parent 33544e0 commit 4ef8fd3

File tree

7 files changed

+35
-6
lines changed

7 files changed

+35
-6
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ per-file-ignores =
6262
# S101: Allow the use of assert within the tests directory, since tests require it.
6363
tests/**.py: S101
6464
# ignores for auto-generated files
65-
ansible_wisdom/ai/api/mode_mesh/grpc_pb/**.py: E402, E501, E712
65+
ansible_wisdom/ai/api/model_client/grpc_pb/**.py: E402, E501, E712
6666
ansible_wisdom/users/migrations/0001_initial.py: E501
6767

6868
# Count the number of occurrences of each error/warning code and print a report:

.github/workflows/pre-commit.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: pre-commit
2+
3+
on:
4+
push:
5+
# tags:
6+
# - v*
7+
branches:
8+
- main
9+
pull_request:
10+
branches:
11+
- main
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
pre-commit:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
22+
- name: Set up python3
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: '3.10'
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install pre-commit
31+
32+
- name: Run pre-commit
33+
uses: pre-commit/action@v3.0.0

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ repos:
55
- id: isort
66
name: isort (python)
77
- repo: https://github.com/ambv/black
8-
rev: 22.12.0
8+
rev: 23.1.0
99
hooks:
1010
- id: black
1111
args: [--safe, --quiet, --line-length, "100"]

ansible_wisdom/ai/api/model_client/grpc_pb/inference_pb2.py

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ansible_wisdom/ai/api/model_client/grpc_pb/management_pb2.py

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ansible_wisdom/ai/api/utils/request.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88

99
def openai_to_wisdom(payload: Payload) -> Tuple[Payload, str]:
10-
1110
# remove extra newlines from end of context
1211
context_lines = payload.prompt.strip('\n').split("\n")
1312
context_last_line = context_lines[-1].strip()

ansible_wisdom/users/migrations/0001_initial.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88

99
class Migration(migrations.Migration):
10-
1110
initial = True
1211

1312
dependencies = [

0 commit comments

Comments
 (0)