Skip to content

Commit 95a4c69

Browse files
authored
Merge pull request #27 from Nayjest/dev
Dev
2 parents 9ecb9f9 + c4a1266 commit 95a4c69

15 files changed

+3663
-412
lines changed

.flake8

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[flake8]
2+
max-line-length = 100

.github/workflows/ai-code-review.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: AI Code Review
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
review:
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
contents: read
13+
pull-requests: write # to leave the summary comment
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
- name: Set up Python 3.11
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.11"
23+
- name: Install AI Code Review tool
24+
run: |
25+
pip install ai-code-review==0.2.1
26+
- name: Run AI code review
27+
env:
28+
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
29+
LLM_API_TYPE: openai
30+
MODEL: "gpt-4.1"
31+
run: |
32+
ai-code-review
33+
- uses: actions/upload-artifact@v4
34+
with:
35+
name: ai-code-review-results
36+
path: code-review-report.txt
37+
- name: Comment on PR with review
38+
uses: actions/github-script@v7
39+
with:
40+
script: |
41+
const fs = require('fs');
42+
43+
const reportFile = 'code-review-report.txt';
44+
if (!fs.existsSync(reportFile)) {
45+
core.info('No review report found.');
46+
return;
47+
}
48+
49+
const body = fs.readFileSync(reportFile, 'utf8');
50+
51+
await github.rest.issues.createComment({
52+
owner: context.repo.owner,
53+
repo: context.repo.repo,
54+
issue_number: context.issue.number,
55+
body
56+
});

.github/workflows/cr.yml

Lines changed: 0 additions & 99 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -51,82 +51,6 @@ coverage.xml
5151
.pytest_cache/
5252
cover/
5353

54-
# Translations
55-
*.mo
56-
*.pot
57-
58-
# Django stuff:
59-
*.log
60-
local_settings.py
61-
db.sqlite3
62-
db.sqlite3-journal
63-
64-
# Flask stuff:
65-
instance/
66-
.webassets-cache
67-
68-
# Scrapy stuff:
69-
.scrapy
70-
71-
# Sphinx documentation
72-
docs/_build/
73-
74-
# PyBuilder
75-
.pybuilder/
76-
target/
77-
78-
# Jupyter Notebook
79-
.ipynb_checkpoints
80-
81-
# IPython
82-
profile_default/
83-
ipython_config.py
84-
85-
# pyenv
86-
# For a library or package, you might want to ignore these files since the code is
87-
# intended to run in multiple environments; otherwise, check them in:
88-
# .python-version
89-
90-
# pipenv
91-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94-
# install all needed dependencies.
95-
#Pipfile.lock
96-
97-
# UV
98-
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99-
# This is especially recommended for binary packages to ensure reproducibility, and is more
100-
# commonly ignored for libraries.
101-
#uv.lock
102-
103-
# poetry
104-
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105-
# This is especially recommended for binary packages to ensure reproducibility, and is more
106-
# commonly ignored for libraries.
107-
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108-
#poetry.lock
109-
110-
# pdm
111-
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112-
#pdm.lock
113-
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114-
# in version control.
115-
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116-
.pdm.toml
117-
.pdm-python
118-
.pdm-build/
119-
120-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121-
__pypackages__/
122-
123-
# Celery stuff
124-
celerybeat-schedule
125-
celerybeat.pid
126-
127-
# SageMath parsed files
128-
*.sage.py
129-
13054
# Environments
13155
.env
13256
.venv
@@ -136,43 +60,7 @@ ENV/
13660
env.bak/
13761
venv.bak/
13862

139-
# Spyder project settings
140-
.spyderproject
141-
.spyproject
142-
143-
# Rope project settings
144-
.ropeproject
145-
146-
# mkdocs documentation
147-
/site
148-
149-
# mypy
150-
.mypy_cache/
151-
.dmypy.json
152-
dmypy.json
153-
154-
# Pyre type checker
155-
.pyre/
156-
157-
# pytype static type analyzer
158-
.pytype/
159-
160-
# Cython debug symbols
161-
cython_debug/
162-
163-
# PyCharm
164-
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165-
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166-
# and can be added to the global gitignore or merged into this file. For a more nuclear
167-
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
168-
#.idea/
169-
170-
# Ruff stuff:
171-
.ruff_cache/
172-
173-
# PyPI configuration file
174-
.pypirc
175-
17663
.idea
17764
.aico
178-
storage
65+
storage
66+
code-review-report.txt

Makefile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
cs:
2+
flake8 .
3+
black:
4+
black .
5+
6+
7+
install:
8+
pip install -r requirements.txt
9+
10+
pkg:
11+
python -m poetry build
12+
13+
clean-dist:
14+
python -c "import shutil, os; shutil.rmtree('dist', ignore_errors=True); os.makedirs('dist', exist_ok=True)"
15+
clear-dist: clean-dist
16+
cln-dist: clean-dist
17+
clr-dist: clean-dist
18+
19+
publish:
20+
python -c "import os;t=os.getenv('PYPI_TOKEN');__import__('subprocess').run(f'python -m twine upload dist/* -u __token__ -p {t}',shell=True)"
21+
22+
upload: publish

0 commit comments

Comments
 (0)