Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .github/workflows/mypy.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/pylint.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/static_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: MyPy Type Checking and Pylint Linting

on: [pull_request]

jobs:
type-check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Set up Python
run: uv sync

- name: Type Check Source Code
run: uv run mypy src

- name: Lint Source Code
run: uv run pylint src
19 changes: 5 additions & 14 deletions .github/workflows/unitttest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,11 @@ jobs:
with:
fetch-depth: 1

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10.12" # Replace with the version you need
run: uv sync

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Unit Tests
run: |
source ./env.sh
python3 tests/test_ast.py
python3 tests/test_polymorphism.py
python3 tests/test_dependency.py
python3 tests/test_rewrite.py
python3 tests/test_alpha_equiv.py
run: uv run pytest
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ result/
evaluation_log.txt
banned.txt

alpharewrite/

*.pdf
*.png
*.csv
4 changes: 2 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extension-pkg-whitelist=
fail-on=

# Specify a score threshold under which the program will exit with error.
fail-under=10
fail-under=9

# Interpret the stdin as a python script, whose filename needs to be passed as
# the module_or_package argument.
Expand Down Expand Up @@ -340,7 +340,7 @@ indent-after-paren=4
indent-string=' '

# Maximum number of characters on a single line.
max-line-length=80
max-line-length=100

# Maximum number of lines in a module.
max-module-lines=1000
Expand Down
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,12 @@ uv sync # create a virtual environment, and install dependencies

## Building TF-Bench From Scratch (Optional)

### Getting Required Data

```sh
./scripts/init.sh
```

This script will download raw data from [Hackage](https://hackage.haskell.org/).

### TF-Bench

This script will build the benchmark (Prelude with NL) from the raw data.

```sh
uv run reprocess_benchmark.py -i benchmark/ -o TF-Bench.json
uv run --project . scripts/preprocess_benchmark.py
```

### TF-Bench_pure
Expand All @@ -40,6 +32,8 @@ cd alpharewrite

stack build
stack exec alpharewrite-exe 1 TF-Bench.json > TF-Bench.pure.json

cd ..
```

For details, please refer to the README of [alpharewrite](https://github.com/SecurityLab-UCD/alpharewrite).
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dependencies = [
"ollama==0.2.1",
"openai==1.30.5",
"pathos>=0.3.3",
"pylint>=3.3.6",
"pytest>=8.0.0",
"python-dotenv==1.0.1",
"requests==2.32.3",
Expand All @@ -31,3 +32,6 @@ dependencies = [
"tree-sitter-haskell==0.21.0",
"types-requests>=2.31.0",
]
[tool.pytest.ini_options]
pythonpath = ["."]

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from funcy import lmap


def main(input_raw_benchmark_path: str = "benchmark", output_path: str = "Benchmark-F.json"):
def main(input_raw_benchmark_path: str = "benchmark", output_path: str = "tfb.json"):

# read in all files ending with .md in the input_raw_benchmark_path
tasks: list[BenchmarkTask] = []
Expand Down
2 changes: 1 addition & 1 deletion src/hoogle.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def main(
# Also transform them back into dictionaries for json format
filtered = (
(tasks_w_dep)
.filter(lambda d: d.dependencies != None)
.filter(lambda d: d.dependencies)
Comment thread
EYH0602 marked this conversation as resolved.
Outdated
.map(lambda x: x.__dict__)
.value
)
Expand Down
83 changes: 0 additions & 83 deletions tests/test_rewrite.py

This file was deleted.

Loading