Download tasks.py from at0day/Gitrew: direct link, hf CLI and curl.
- Browser
- Download file 3.72 kB
-
https://huggingface.co/spaces/at0day/Gitrew/resolve/main/tasks.py
- Command line
-
hf download hf://spaces/at0day/Gitrew/tasks.py
-
curl -L -o tasks.py https://huggingface.co/spaces/at0day/Gitrew/resolve/main/tasks.py
3.72 kB
| # Ground truth data for the Git Commit Reviewer Tasks | |
| EASY_TASK = [ | |
| { | |
| "commit_message": "fixed bug", | |
| "ground_truth": { | |
| "score": 0.1, | |
| "type_valid": False, | |
| "summary_length": 9, | |
| "issues": ["Missing type", "Not imperative mood", "No description of what was fixed"], | |
| "suggestion": "fix: resolve null pointer exception in login flow" | |
| } | |
| } | |
| ] | |
| MEDIUM_TASK = [ | |
| { | |
| "commit_message": "feat(auth): added Google OAuth login", | |
| "ground_truth": { | |
| "score": 0.6, | |
| "type_valid": True, | |
| "summary_length": 35, | |
| "issues": ["Not imperative mood ('added' instead of 'add')"], | |
| "suggestion": "feat(auth): add Google OAuth login" | |
| } | |
| }, | |
| { | |
| "commit_message": "docs: update README with setup instructions", | |
| "ground_truth": { | |
| "score": 1.0, | |
| "type_valid": True, | |
| "summary_length": 43, | |
| "issues": [], | |
| "suggestion": "docs: update README with setup instructions" | |
| } | |
| }, | |
| { | |
| "commit_message": "update stuff", | |
| "ground_truth": { | |
| "score": 0.2, | |
| "type_valid": False, | |
| "summary_length": 12, | |
| "issues": ["Missing type", "Vague description"], | |
| "suggestion": "refactor: simplify data fetching logic" | |
| } | |
| } | |
| ] | |
| HARD_TASK = [ | |
| { | |
| "commit_message": "feat: introduce breaking API changes for user endpoints", | |
| "ground_truth": { | |
| "score": 0.7, | |
| "type_valid": True, | |
| "summary_length": 55, | |
| "issues": ["Missing '!' to indicate breaking change or 'BREAKING CHANGE' in footer"], | |
| "suggestion": "feat!: introduce breaking API changes for user endpoints" | |
| } | |
| }, | |
| { | |
| "commit_message": "fix: resolve crash when loading large datasets\n\nthis happens when datasets exceed 5gb.", | |
| "ground_truth": { | |
| "score": 0.9, | |
| "type_valid": True, | |
| "summary_length": 46, | |
| "issues": ["Body is not properly capitalized"], | |
| "suggestion": "fix: resolve crash when loading large datasets\n\nThis happens when datasets exceed 5gb." | |
| } | |
| }, | |
| { | |
| "commit_message": "chore: Drop support for Python 3.8", | |
| "ground_truth": { | |
| "score": 0.8, | |
| "type_valid": True, | |
| "summary_length": 35, | |
| "issues": ["Summary should be lowercase usually, but strictly speaking imperative mood requires 'drop' not 'Drop'. Missing breaking change indicator."], | |
| "suggestion": "chore!: drop support for Python 3.8" | |
| } | |
| }, | |
| { | |
| "commit_message": "WIP: added tests for refactored components", | |
| "ground_truth": { | |
| "score": 0.3, | |
| "type_valid": False, | |
| "summary_length": 42, | |
| "issues": ["WIP is not a valid conventional commit type", "Not imperative mood ('added' instead of 'add')"], | |
| "suggestion": "test: add tests for refactored components" | |
| } | |
| }, | |
| { | |
| "commit_message": "perf(db): optimize query performance by adding index to User table", | |
| "ground_truth": { | |
| "score": 1.0, | |
| "type_valid": True, | |
| "summary_length": 66, | |
| "issues": [], | |
| "suggestion": "perf(db): optimize query performance by adding index to User table" | |
| } | |
| } | |
| ] | |
| def get_task_data(task_name: str) -> list: | |
| if task_name == "easy": | |
| return EASY_TASK | |
| elif task_name == "medium": | |
| return MEDIUM_TASK | |
| elif task_name == "hard": | |
| return HARD_TASK | |
| else: | |
| return EASY_TASK | |