Skip to content

Commit d84f4cf

Browse files
committed
Initial commit
0 parents  commit d84f4cf

14 files changed

+1323
-0
lines changed

.dockerignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.github/
2+
.pre-commit-config.yaml
3+
4+
Dockerfile
5+
6+
Makefile
7+
8+
requirements-dev.txt

.github/CODEOWNERS

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Licensed under the Apache License, Version 2.0 (the "License");
2+
# you may not use this file except in compliance with the License.
3+
# You may obtain a copy of the License at
4+
#
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
#
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS,
9+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
# See the License for the specific language governing permissions and
11+
# limitations under the License.
12+
13+
* @luiyen

.github/workflows/test-action.yml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Licensed under the Apache License, Version 2.0 (the "License");
2+
# you may not use this file except in compliance with the License.
3+
# You may obtain a copy of the License at
4+
#
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
#
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS,
9+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
# See the License for the specific language governing permissions and
11+
# limitations under the License.
12+
13+
name: "Test Code Review"
14+
15+
on:
16+
pull_request:
17+
paths-ignore:
18+
- "*.md"
19+
- "LICENSE"
20+
21+
jobs:
22+
review:
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: read
26+
pull-requests: write
27+
steps:
28+
- uses: actions/checkout@v3
29+
- name: "Get diff of the pull request"
30+
id: get_diff
31+
shell: bash
32+
env:
33+
DEFAULT_BRANCH: "${{ github.event.repository.default_branch }}"
34+
PULL_REQUEST_HEAD_REF: "${{ github.event.pull_request.head.ref }}"
35+
run: |-
36+
# Fetch the default branch
37+
git fetch origin "${{ env.DEFAULT_BRANCH }}"
38+
# Exclude png files from diff
39+
git diff "origin/${{ env.DEFAULT_BRANCH }}" ":(exclude)*.png" > "diff.txt"
40+
# Put multi-line string into an environment variable
41+
# shellcheck disable=SC2086
42+
{
43+
echo "pull_request_diff<<EOF";
44+
cat "diff.txt";
45+
echo 'EOF';
46+
} >> $GITHUB_OUTPUT
47+
- uses: ./
48+
name: "Code Review"
49+
id: review
50+
with:
51+
apiKey: ${{ secrets.API_KEY }}
52+
githubToken: ${{ secrets.GITHUB_TOKEN }}
53+
githubRepository: ${{ github.repository }}
54+
githubPullRequestNumber: ${{ github.event.pull_request.number }}
55+
gitCommitHash: ${{ github.event.pull_request.head.sha }}
56+
repoId: "microsoft/codereviewer"
57+
temperature: "0.2"
58+
maxNewTokens: "250"
59+
topK: "50"
60+
topP: "0.95"
61+
pullRequestDiff: |-
62+
${{ steps.get_diff.outputs.pull_request_diff }}
63+
pullRequestChunkSize: "3500"
64+
logLevel: "DEBUG"

.gitignore

+136
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
!dbt_artifacts_parser/parsers/manifest
36+
!dbt_artifacts_parser/resources/manifest
37+
38+
# Installer logs
39+
pip-log.txt
40+
pip-delete-this-directory.txt
41+
42+
# Unit test / coverage reports
43+
htmlcov/
44+
.tox/
45+
.nox/
46+
.coverage
47+
.coverage.*
48+
.cache
49+
nosetests.xml
50+
coverage.xml
51+
*.cover
52+
*.py,cover
53+
.hypothesis/
54+
.pytest_cache/
55+
56+
# Translations
57+
*.mo
58+
*.pot
59+
60+
# Django stuff:
61+
*.log
62+
local_settings.py
63+
db.sqlite3
64+
db.sqlite3-journal
65+
66+
# Flask stuff:
67+
instance/
68+
.webassets-cache
69+
70+
# Scrapy stuff:
71+
.scrapy
72+
73+
# Sphinx documentation
74+
docs/_build/
75+
76+
# PyBuilder
77+
target/
78+
79+
# Jupyter Notebook
80+
.ipynb_checkpoints
81+
82+
# IPython
83+
profile_default/
84+
ipython_config.py
85+
86+
# pyenv
87+
.python-version
88+
89+
# pipenv
90+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
91+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
92+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
93+
# install all needed dependencies.
94+
#Pipfile.lock
95+
96+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
97+
__pypackages__/
98+
99+
# Celery stuff
100+
celerybeat-schedule
101+
celerybeat.pid
102+
103+
# SageMath parsed files
104+
*.sage.py
105+
106+
# Environments
107+
.env
108+
.venv
109+
env/
110+
venv/
111+
ENV/
112+
env.bak/
113+
venv.bak/
114+
115+
# Spyder project settings
116+
.spyderproject
117+
.spyproject
118+
119+
# Rope project settings
120+
.ropeproject
121+
122+
# mkdocs documentation
123+
/site
124+
125+
# mypy
126+
.mypy_cache/
127+
.dmypy.json
128+
dmypy.json
129+
130+
# Pyre type checker
131+
.pyre/
132+
133+
# VSCode
134+
.vscode
135+
.secrets
136+
.DS_Store

.pre-commit-config.yaml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Licensed under the Apache License, Version 2.0 (the "License");
2+
# you may not use this file except in compliance with the License.
3+
# You may obtain a copy of the License at
4+
#
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
#
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS,
9+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
# See the License for the specific language governing permissions and
11+
# limitations under the License.
12+
13+
repos:
14+
- repo: https://github.com/pre-commit/pre-commit-hooks
15+
rev: v4.4.0
16+
hooks:
17+
- id: end-of-file-fixer
18+
- id: trailing-whitespace
19+
- id: check-yaml
20+
- repo: https://github.com/pycqa/isort
21+
rev: 5.12.0
22+
hooks:
23+
- id: isort
24+
name: isort (python)
25+
- repo: https://github.com/pycqa/pylint
26+
rev: v2.17.2
27+
hooks:
28+
- id: pylint
29+
- repo: https://github.com/rhysd/actionlint
30+
rev: v1.6.24
31+
hooks:
32+
- id: actionlint-docker
33+
- repo: https://github.com/hadolint/hadolint
34+
rev: v2.12.0
35+
hooks:
36+
- id: hadolint

0 commit comments

Comments
 (0)