Skip to content

Commit 3231166

Browse files
Initial commit
0 parents  commit 3231166

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+8808
-0
lines changed

.github/workflows/black.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Black Formatting
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- 'repoaudit-v[0-9]+\.[0-9]+'
8+
paths:
9+
- 'src/**/*.py'
10+
11+
push:
12+
branches:
13+
- main
14+
- 'repoaudit-v[0-9]+\.[0-9]+'
15+
paths:
16+
- 'src/**/*.py'
17+
18+
jobs:
19+
black:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
token: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Set up Python
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: '3.x'
33+
34+
- name: Install Black
35+
run: pip install black
36+
37+
- name: Run Black
38+
run: |
39+
if [ "${{ github.event_name }}" = "pull_request" ]; then
40+
echo "Checking formatting on pull_request..."
41+
black --check src/
42+
else
43+
echo "Auto-formatting and pushing changes on push..."
44+
black src/
45+
if [[ `git status --porcelain` ]]; then
46+
git config user.name "github-actions[bot]"
47+
git config user.email "github-actions[bot]@users.noreply.github.com"
48+
git add src/
49+
git commit -m "chore: auto-format Python code in src/ with black"
50+
git push
51+
else
52+
echo "No formatting changes needed."
53+
fi
54+
fi

.github/workflows/mypy.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Mypy Type Checking
2+
3+
on:
4+
push:
5+
paths:
6+
- 'src/**/*.py'
7+
8+
pull_request:
9+
paths:
10+
- 'src/**/*.py'
11+
12+
jobs:
13+
mypy:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.x'
24+
25+
- name: Cache pip dependencies
26+
uses: actions/cache@v4
27+
with:
28+
path: ~/.cache/pip
29+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
30+
restore-keys: |
31+
${{ runner.os }}-pip-
32+
33+
- name: Install dependencies
34+
run: |
35+
python -m pip install --upgrade pip
36+
pip install -r requirements.txt
37+
pip install mypy
38+
39+
- name: Run Mypy
40+
run: mypy src/
41+

.github/workflows/slack.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Notify Slack on Push
2+
3+
on:
4+
push:
5+
branches: ['**']
6+
7+
jobs:
8+
slack_notify:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
# 1. Build the plain-text body and expose it as multiline output
13+
- name: Build Slack text
14+
id: build
15+
shell: bash
16+
run: |
17+
set -euo pipefail
18+
19+
REPO_URL="https://github.com/${{ github.repository }}"
20+
COMPARE_URL="${{ github.event.compare }}"
21+
22+
text="*New push to branch \`${{ github.ref_name }}\` by \`${{ github.actor }}\`*"
23+
while IFS= read -r c; do
24+
sha=$(jq -r '.id' <<<"$c")
25+
msg=$(jq -r '.message' <<<"$c" | tr '\n' ' ')
26+
text+=$'\n'
27+
text+="• <${REPO_URL}/commit/${sha}|${sha:0:7}>: ${msg}"
28+
done < <(jq -c '.commits[]' "$GITHUB_EVENT_PATH")
29+
text+=$'\n\n'
30+
text+="🔗 *<${COMPARE_URL}|View all changes>*"
31+
32+
# Multiline output (<<EOF syntax)
33+
{
34+
echo "text<<EOF"
35+
printf '%s\n' "$text"
36+
echo "EOF"
37+
} >> "$GITHUB_OUTPUT"
38+
39+
# 2. Post to Slack – the action serialises this object once
40+
- name: Send Slack notification
41+
uses: slackapi/slack-github-action@v1.24.0
42+
with:
43+
payload: |
44+
{
45+
"text": ${{ toJson(steps.build.outputs.text) }}
46+
}
47+
env:
48+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
49+
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

.gitignore

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
.DS_Store
2+
3+
# Byte-compiled / optimized / DLL files
4+
__pycache__/
5+
*.py[cod]
6+
*$py.class
7+
**/*.pyc
8+
9+
# C extensions
10+
*.so
11+
12+
*.pyc
13+
14+
# Ignore all content in benchmark directory...
15+
benchmark/*/
16+
!benchmark/*/toy/
17+
!benchmark/*/toy/**
18+
19+
log/
20+
result/
21+
seedcache/
22+
IRDB/
23+
24+
# **/run_info.json
25+
**.log
26+
result**
27+
bugscan_jy.sh
28+
extract_jy.sh
29+
30+
# Distribution / packaging
31+
.Python
32+
build/
33+
develop-eggs/
34+
dist/
35+
downloads/
36+
eggs/
37+
.eggs/
38+
lib/
39+
lib64/
40+
parts/
41+
sdist/
42+
var/
43+
wheels/
44+
share/python-wheels/
45+
*.egg-info/
46+
.installed.cfg
47+
*.egg
48+
MANIFEST
49+
50+
# PyInstaller
51+
# Usually these files are written by a python script from a template
52+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
53+
*.manifest
54+
*.spec
55+
56+
# Installer logs
57+
pip-log.txt
58+
pip-delete-this-directory.txt
59+
60+
# Unit test / coverage reports
61+
htmlcov/
62+
.tox/
63+
.nox/
64+
.coverage
65+
.coverage.*
66+
.cache
67+
nosetests.xml
68+
coverage.xml
69+
*.cover
70+
*.py,cover
71+
.hypothesis/
72+
.pytest_cache/
73+
cover/
74+
75+
# Translations
76+
*.mo
77+
*.pot
78+
79+
# Django stuff:
80+
*.log
81+
local_settings.py
82+
db.sqlite3
83+
db.sqlite3-journal
84+
85+
# Flask stuff:
86+
instance/
87+
.webassets-cache
88+
89+
# Scrapy stuff:
90+
.scrapy
91+
92+
# Sphinx documentation
93+
docs/_build/
94+
95+
# PyBuilder
96+
.pybuilder/
97+
target/
98+
99+
# Jupyter Notebook
100+
.ipynb_checkpoints
101+
102+
# IPython
103+
profile_default/
104+
ipython_config.py
105+
106+
# pyenv
107+
# For a library or package, you might want to ignore these files since the code is
108+
# intended to run in multiple environments; otherwise, check them in:
109+
# .python-version
110+
111+
# pipenv
112+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
113+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
114+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
115+
# install all needed dependencies.
116+
#Pipfile.lock
117+
118+
# poetry
119+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
120+
# This is especially recommended for binary packages to ensure reproducibility, and is more
121+
# commonly ignored for libraries.
122+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
123+
#poetry.lock
124+
125+
# pdm
126+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
127+
#pdm.lock
128+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
129+
# in version control.
130+
# https://pdm.fming.dev/#use-with-ide
131+
.pdm.toml
132+
133+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
134+
__pypackages__/
135+
136+
# Celery stuff
137+
celerybeat-schedule
138+
celerybeat.pid
139+
140+
# SageMath parsed files
141+
*.sage.py
142+
143+
# Environments
144+
.env
145+
.venv
146+
env/
147+
venv/
148+
ENV/
149+
env.bak/
150+
venv.bak/
151+
152+
# Spyder project settings
153+
.spyderproject
154+
.spyproject
155+
156+
# Rope project settings
157+
.ropeproject
158+
159+
# mkdocs documentation
160+
/site
161+
162+
# mypy
163+
.mypy_cache/
164+
.dmypy.json
165+
dmypy.json
166+
167+
# Pyre type checker
168+
.pyre/
169+
170+
# pytype static type analyzer
171+
.pytype/
172+
173+
# Cython debug symbols
174+
cython_debug/
175+
176+
# PyCharm
177+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
178+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
179+
# and can be added to the global gitignore or merged into this file. For a more nuclear
180+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
181+
#.idea/
182+
183+
# VS Code settings
184+
.vscode/
185+
186+
testcases/**
187+
188+
# java class files in regression testing
189+
src/test/regression_testing/test_files/java/**/*.class
190+
191+
# files used for regression testing script
192+
src/test/regression_testing/regression_results.md
193+
src/test/regression_testing/dif.txt

0 commit comments

Comments
 (0)