diff-to-test 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. diff_to_test-0.0.1/.diff2test.yml +12 -0
  2. diff_to_test-0.0.1/.editorconfig +15 -0
  3. diff_to_test-0.0.1/.gitattributes +1 -0
  4. diff_to_test-0.0.1/.github/ISSUE_TEMPLATE/bug_report.yml +32 -0
  5. diff_to_test-0.0.1/.github/ISSUE_TEMPLATE/config.yml +1 -0
  6. diff_to_test-0.0.1/.github/ISSUE_TEMPLATE/feature_request.yml +24 -0
  7. diff_to_test-0.0.1/.github/ISSUE_TEMPLATE/new_profile.yml +26 -0
  8. diff_to_test-0.0.1/.github/pull_request_template.md +20 -0
  9. diff_to_test-0.0.1/.github/workflows/action-test.yml +86 -0
  10. diff_to_test-0.0.1/.github/workflows/ci.yml +49 -0
  11. diff_to_test-0.0.1/.github/workflows/diff2test.yml +37 -0
  12. diff_to_test-0.0.1/.github/workflows/publish.yml +107 -0
  13. diff_to_test-0.0.1/.github/workflows/release-please.yml +18 -0
  14. diff_to_test-0.0.1/.gitignore +32 -0
  15. diff_to_test-0.0.1/.pre-commit-config.yaml +13 -0
  16. diff_to_test-0.0.1/.release-please-manifest.json +3 -0
  17. diff_to_test-0.0.1/CODE_OF_CONDUCT.md +30 -0
  18. diff_to_test-0.0.1/CONTRIBUTING.md +55 -0
  19. diff_to_test-0.0.1/LICENSE +21 -0
  20. diff_to_test-0.0.1/PKG-INFO +140 -0
  21. diff_to_test-0.0.1/README.md +107 -0
  22. diff_to_test-0.0.1/README.tr.md +107 -0
  23. diff_to_test-0.0.1/SECURITY.md +25 -0
  24. diff_to_test-0.0.1/action.yml +150 -0
  25. diff_to_test-0.0.1/docs/assets/cli-demo.gif +0 -0
  26. diff_to_test-0.0.1/docs/configuration.md +103 -0
  27. diff_to_test-0.0.1/docs/writing-profiles.md +59 -0
  28. diff_to_test-0.0.1/pyproject.toml +83 -0
  29. diff_to_test-0.0.1/release-please-config.json +14 -0
  30. diff_to_test-0.0.1/src/diff2test/__init__.py +3 -0
  31. diff_to_test-0.0.1/src/diff2test/__main__.py +6 -0
  32. diff_to_test-0.0.1/src/diff2test/cli.py +393 -0
  33. diff_to_test-0.0.1/src/diff2test/config.py +213 -0
  34. diff_to_test-0.0.1/src/diff2test/context_builder.py +318 -0
  35. diff_to_test-0.0.1/src/diff2test/git_handler.py +255 -0
  36. diff_to_test-0.0.1/src/diff2test/github_api.py +408 -0
  37. diff_to_test-0.0.1/src/diff2test/llm_client.py +301 -0
  38. diff_to_test-0.0.1/src/diff2test/models.py +106 -0
  39. diff_to_test-0.0.1/src/diff2test/pipeline.py +79 -0
  40. diff_to_test-0.0.1/src/diff2test/profiles/__init__.py +126 -0
  41. diff_to_test-0.0.1/src/diff2test/profiles/dart-flutter.yaml +17 -0
  42. diff_to_test-0.0.1/src/diff2test/profiles/generic.yaml +17 -0
  43. diff_to_test-0.0.1/src/diff2test/profiles/python-fastapi.yaml +19 -0
  44. diff_to_test-0.0.1/src/diff2test/prompts/__init__.py +11 -0
  45. diff_to_test-0.0.1/src/diff2test/prompts/fix.md +22 -0
  46. diff_to_test-0.0.1/src/diff2test/prompts/generate.md +23 -0
  47. diff_to_test-0.0.1/src/diff2test/prompts/system.md +8 -0
  48. diff_to_test-0.0.1/src/diff2test/runner.py +382 -0
  49. diff_to_test-0.0.1/src/diff2test/summary.py +18 -0
  50. diff_to_test-0.0.1/src/diff2test/symbols.py +99 -0
  51. diff_to_test-0.0.1/tests/__init__.py +0 -0
  52. diff_to_test-0.0.1/tests/e2e/__init__.py +0 -0
  53. diff_to_test-0.0.1/tests/e2e/fixtures/python_sample/pyproject.toml +7 -0
  54. diff_to_test-0.0.1/tests/e2e/fixtures/python_sample/src/sample_app/__init__.py +1 -0
  55. diff_to_test-0.0.1/tests/e2e/fixtures/python_sample/src/sample_app/pricing.py +8 -0
  56. diff_to_test-0.0.1/tests/e2e/fixtures/python_sample/tests/test_pricing.py +13 -0
  57. diff_to_test-0.0.1/tests/e2e/test_e2e_live.py +35 -0
  58. diff_to_test-0.0.1/tests/e2e/test_e2e_pipeline.py +111 -0
  59. diff_to_test-0.0.1/tests/fakes.py +21 -0
  60. diff_to_test-0.0.1/tests/fixtures/diffs/sample.diff +42 -0
  61. diff_to_test-0.0.1/tests/test_cli.py +158 -0
  62. diff_to_test-0.0.1/tests/test_cli_ci.py +217 -0
  63. diff_to_test-0.0.1/tests/test_config_detect.py +45 -0
  64. diff_to_test-0.0.1/tests/test_config_excludes.py +23 -0
  65. diff_to_test-0.0.1/tests/test_config_merge.py +66 -0
  66. diff_to_test-0.0.1/tests/test_config_yaml.py +84 -0
  67. diff_to_test-0.0.1/tests/test_context_examples.py +43 -0
  68. diff_to_test-0.0.1/tests/test_context_paths.py +58 -0
  69. diff_to_test-0.0.1/tests/test_context_prompts.py +73 -0
  70. diff_to_test-0.0.1/tests/test_context_source.py +41 -0
  71. diff_to_test-0.0.1/tests/test_diff_parser.py +64 -0
  72. diff_to_test-0.0.1/tests/test_git_filter.py +71 -0
  73. diff_to_test-0.0.1/tests/test_git_wrapper.py +103 -0
  74. diff_to_test-0.0.1/tests/test_github_api.py +228 -0
  75. diff_to_test-0.0.1/tests/test_github_commit.py +88 -0
  76. diff_to_test-0.0.1/tests/test_github_context.py +52 -0
  77. diff_to_test-0.0.1/tests/test_github_loop_guard.py +142 -0
  78. diff_to_test-0.0.1/tests/test_guards.py +40 -0
  79. diff_to_test-0.0.1/tests/test_llm_client.py +281 -0
  80. diff_to_test-0.0.1/tests/test_llm_extract.py +29 -0
  81. diff_to_test-0.0.1/tests/test_models.py +71 -0
  82. diff_to_test-0.0.1/tests/test_pipeline.py +75 -0
  83. diff_to_test-0.0.1/tests/test_profiles.py +129 -0
  84. diff_to_test-0.0.1/tests/test_prompts.py +17 -0
  85. diff_to_test-0.0.1/tests/test_runner_healing.py +140 -0
  86. diff_to_test-0.0.1/tests/test_runner_report.py +46 -0
  87. diff_to_test-0.0.1/tests/test_runner_subprocess.py +69 -0
  88. diff_to_test-0.0.1/tests/test_runner_transaction.py +54 -0
  89. diff_to_test-0.0.1/tests/test_smoke.py +18 -0
  90. diff_to_test-0.0.1/tests/test_symbols.py +59 -0
@@ -0,0 +1,12 @@
1
+ # diff2test self-testing configuration
2
+ test_command: "python -m pytest {test_path} -q"
3
+ profile: generic
4
+ provider: github
5
+ base_ref: origin/main
6
+ max_files: 5
7
+ max_diff_lines: 500
8
+ max_retries: 3
9
+ exclude:
10
+ - "tests/**"
11
+ - "docs/**"
12
+ extra_instructions: "Use pytest, tmp_path, httpx.MockTransport, and tests.fakes.FakeLLMClient. Never call real external APIs."
@@ -0,0 +1,15 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ end_of_line = lf
6
+ insert_final_newline = true
7
+ trim_trailing_whitespace = true
8
+ indent_style = space
9
+ indent_size = 4
10
+
11
+ [*.{yml,yaml,json,toml}]
12
+ indent_size = 2
13
+
14
+ [Makefile]
15
+ indent_style = tab
@@ -0,0 +1 @@
1
+ * text=auto eol=lf
@@ -0,0 +1,32 @@
1
+ name: Bug Report
2
+ description: Report a bug in diff2test CLI or GitHub Action
3
+ title: "fix: "
4
+ labels: ["bug"]
5
+ body:
6
+ - type: textarea
7
+ id: description
8
+ attributes:
9
+ label: Description
10
+ description: Clear description of what happened vs. what you expected.
11
+ validations:
12
+ required: true
13
+ - type: textarea
14
+ id: reproduction
15
+ attributes:
16
+ label: Steps to Reproduce
17
+ description: Command, workflow snippet, or .diff2test.yml used.
18
+ validations:
19
+ required: true
20
+ - type: input
21
+ id: environment
22
+ attributes:
23
+ label: Environment
24
+ description: OS, Python version, diff2test version, and LLM provider.
25
+ placeholder: "Windows 11 / Python 3.12 / diff2test 0.1.0 / github"
26
+ validations:
27
+ required: true
28
+ - type: textarea
29
+ id: logs
30
+ attributes:
31
+ label: Logs / Error Output
32
+ render: shell
@@ -0,0 +1 @@
1
+ blank_issues_enabled: false
@@ -0,0 +1,24 @@
1
+ name: Feature Request
2
+ description: Suggest a new capability, LLM provider, or CLI/Action improvement
3
+ title: "feat: "
4
+ labels: ["enhancement"]
5
+ body:
6
+ - type: textarea
7
+ id: problem
8
+ attributes:
9
+ label: Problem / Use Case
10
+ description: What workflow or problem would this solve?
11
+ validations:
12
+ required: true
13
+ - type: textarea
14
+ id: proposal
15
+ attributes:
16
+ label: Proposed Solution
17
+ description: How should it work from a user perspective?
18
+ validations:
19
+ required: true
20
+ - type: textarea
21
+ id: alternatives
22
+ attributes:
23
+ label: Alternatives Considered
24
+ description: Optional workarounds or alternative designs.
@@ -0,0 +1,26 @@
1
+ name: New Language / Framework Profile
2
+ description: Propose or request a test generation profile for a language or framework
3
+ title: "profile: "
4
+ labels: ["profile", "enhancement"]
5
+ body:
6
+ - type: input
7
+ id: language
8
+ attributes:
9
+ label: Language & Framework
10
+ placeholder: "TypeScript / Vitest"
11
+ validations:
12
+ required: true
13
+ - type: input
14
+ id: test_command
15
+ attributes:
16
+ label: Default Test Command
17
+ placeholder: "npx vitest run {test_path}"
18
+ validations:
19
+ required: true
20
+ - type: textarea
21
+ id: conventions
22
+ attributes:
23
+ label: Test Conventions & Mocking Library
24
+ description: File naming pattern, test directory, preferred mocking library, and key rules.
25
+ validations:
26
+ required: true
@@ -0,0 +1,20 @@
1
+ ## Summary
2
+
3
+ <!-- Briefly describe what this PR changes and why. -->
4
+
5
+ ## Task IDs
6
+
7
+ <!-- e.g. Refs: F1-B2-T1, F1-B2-T2 -->
8
+ Refs:
9
+
10
+ ## Verification
11
+
12
+ - [ ] `ruff check .`
13
+ - [ ] `ruff format --check .`
14
+ - [ ] `pytest`
15
+
16
+ ## Checklist
17
+
18
+ - [ ] Changes are scoped to a single branch/feature
19
+ - [ ] New behavior is covered by deterministic unit tests (no live LLM calls)
20
+ - [ ] Safety invariants (no test overwrites, transactional cleanup, loop guards) are preserved
@@ -0,0 +1,86 @@
1
+ name: Action Self-Test
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ action-self-test:
10
+ name: Action Self-Test
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Checkout diff2test
14
+ uses: actions/checkout@v4
15
+
16
+ - name: Set up Python and pytest for fixture repo
17
+ uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.12"
20
+
21
+ - name: Install pytest
22
+ run: python -m pip install --quiet pytest
23
+
24
+ - name: Create fixture repository and PR event payload
25
+ run: |
26
+ mkdir -p /tmp/fixture-repo/src
27
+ cd /tmp/fixture-repo
28
+ git init -b main
29
+ git config user.name "Fixture User"
30
+ git config user.email "fixture@example.com"
31
+ printf "[project]\nname = 'fixture'\n" > pyproject.toml
32
+ printf "" > src/__init__.py
33
+ git add .
34
+ git commit -m "initial"
35
+
36
+ git checkout -b feat/calc
37
+ cat <<'EOF' > src/calc.py
38
+ def add(a: int, b: int) -> int:
39
+ return a + b
40
+ EOF
41
+ git add src/calc.py
42
+ git commit -m "feat: add calc.add"
43
+
44
+ cat <<'EOF' > /tmp/event.json
45
+ {
46
+ "action": "synchronize",
47
+ "number": 1,
48
+ "pull_request": {
49
+ "number": 1,
50
+ "base": {"ref": "main", "sha": "base123"},
51
+ "head": {
52
+ "ref": "feat/calc",
53
+ "sha": "head456",
54
+ "repo": {"full_name": "owner/fixture"}
55
+ }
56
+ }
57
+ }
58
+ EOF
59
+
60
+ - id: diff2test
61
+ name: Run diff2test composite action
62
+ uses: ./
63
+ with:
64
+ working-directory: /tmp/fixture-repo
65
+ mode: comment
66
+ test-command: "python -m pytest {test_path} -q"
67
+ fail-on-error: "true"
68
+ env:
69
+ GITHUB_EVENT_PATH: /tmp/event.json
70
+ GITHUB_REPOSITORY: owner/fixture
71
+ GITHUB_ACTOR: developer
72
+ DIFF2TEST_SKIP_GITHUB_API: "1"
73
+ DIFF2TEST_FAKE_LLM_RESPONSE: |
74
+ ```python
75
+ from src.calc import add
76
+
77
+
78
+ def test_add():
79
+ assert add(2, 3) == 5
80
+ ```
81
+
82
+ - name: Verify action outputs and report
83
+ run: |
84
+ test "${{ steps.diff2test.outputs.generated-count }}" = "1"
85
+ test "${{ steps.diff2test.outputs.failed-count }}" = "0"
86
+ test -f "${{ steps.diff2test.outputs.report-path }}"
@@ -0,0 +1,49 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ concurrency:
13
+ group: ${{ github.workflow }}-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ lint:
18
+ name: Lint
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ - uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.12"
25
+ - name: Install ruff
26
+ run: python -m pip install ruff==0.17.6
27
+ - name: Check lint
28
+ run: ruff check .
29
+ - name: Check format
30
+ run: ruff format --check .
31
+
32
+ test:
33
+ name: Test (${{ matrix.os }}, Python ${{ matrix.python-version }})
34
+ strategy:
35
+ fail-fast: false
36
+ matrix:
37
+ os: [ubuntu-latest, windows-latest]
38
+ python-version: ["3.10", "3.11", "3.12"]
39
+ runs-on: ${{ matrix.os }}
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+ - uses: actions/setup-python@v5
43
+ with:
44
+ python-version: ${{ matrix.python-version }}
45
+ cache: pip
46
+ - name: Install package and dev dependencies
47
+ run: python -m pip install -e ".[dev]"
48
+ - name: Run tests with coverage
49
+ run: pytest --cov=diff2test
@@ -0,0 +1,37 @@
1
+ name: diff2test
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, synchronize]
6
+
7
+ permissions:
8
+ contents: read
9
+ pull-requests: write
10
+ models: read
11
+
12
+ jobs:
13
+ generate-tests:
14
+ name: Generate Unit Tests
15
+ runs-on: ubuntu-latest
16
+ if: startsWith(github.head_ref, 'feat/') && github.actor != 'github-actions[bot]'
17
+ steps:
18
+ - name: Checkout repository
19
+ uses: actions/checkout@v4
20
+ with:
21
+ fetch-depth: 0
22
+
23
+ - name: Set up Python 3.12
24
+ uses: actions/setup-python@v5
25
+ with:
26
+ python-version: "3.12"
27
+
28
+ - name: Install project and test dependencies
29
+ run: python -m pip install --quiet -e ".[dev]"
30
+
31
+ - name: Run diff2test
32
+ uses: ./
33
+ with:
34
+ mode: comment
35
+ provider: github
36
+ test-command: "python -m pytest {test_path} -q"
37
+ fail-on-error: "false"
@@ -0,0 +1,107 @@
1
+ name: Publish Package
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*.*.*"
7
+ workflow_dispatch:
8
+ inputs:
9
+ target:
10
+ description: "Target PyPI index"
11
+ required: true
12
+ type: choice
13
+ default: testpypi
14
+ options:
15
+ - testpypi
16
+ - pypi
17
+
18
+ jobs:
19
+ build:
20
+ name: Build Distribution
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - name: Checkout repository
24
+ uses: actions/checkout@v4
25
+
26
+ - name: Set up Python 3.12
27
+ uses: actions/setup-python@v5
28
+ with:
29
+ python-version: "3.12"
30
+
31
+ - name: Install build tools
32
+ run: python -m pip install --upgrade build twine
33
+
34
+ - name: Build sdist and wheel
35
+ run: python -m build
36
+
37
+ - name: Check distribution metadata
38
+ run: twine check dist/*
39
+
40
+ - name: Upload build artifacts
41
+ uses: actions/upload-artifact@v4
42
+ with:
43
+ name: dist
44
+ path: dist/
45
+
46
+ publish-testpypi:
47
+ name: Publish to TestPyPI
48
+ needs: build
49
+ if: github.event_name == 'workflow_dispatch' && inputs.target == 'testpypi'
50
+ runs-on: ubuntu-latest
51
+ environment:
52
+ name: testpypi
53
+ url: https://test.pypi.org/p/diff-to-test
54
+ permissions:
55
+ id-token: write
56
+ steps:
57
+ - name: Download build artifacts
58
+ uses: actions/download-artifact@v4
59
+ with:
60
+ name: dist
61
+ path: dist/
62
+
63
+ - name: Publish to TestPyPI
64
+ uses: pypa/gh-action-pypi-publish@release/v1
65
+ with:
66
+ repository-url: https://test.pypi.org/legacy/
67
+
68
+ publish-pypi:
69
+ name: Publish to PyPI
70
+ needs: build
71
+ if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && inputs.target == 'pypi')
72
+ runs-on: ubuntu-latest
73
+ environment:
74
+ name: pypi
75
+ url: https://pypi.org/p/diff-to-test
76
+ permissions:
77
+ id-token: write
78
+ steps:
79
+ - name: Download build artifacts
80
+ uses: actions/download-artifact@v4
81
+ with:
82
+ name: dist
83
+ path: dist/
84
+
85
+ - name: Publish to PyPI
86
+ uses: pypa/gh-action-pypi-publish@release/v1
87
+
88
+ update-major-tag:
89
+ name: Update Moving Major Tag
90
+ needs: publish-pypi
91
+ if: startsWith(github.ref, 'refs/tags/v')
92
+ runs-on: ubuntu-latest
93
+ permissions:
94
+ contents: write
95
+ steps:
96
+ - name: Checkout repository
97
+ uses: actions/checkout@v4
98
+ with:
99
+ fetch-depth: 0
100
+
101
+ - name: Force-update major version tag
102
+ run: |
103
+ MAJOR_TAG="${GITHUB_REF_NAME%%.*}"
104
+ git config user.name "github-actions[bot]"
105
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
106
+ git tag -fa "$MAJOR_TAG" -m "Release $GITHUB_REF_NAME"
107
+ git push -f origin "refs/tags/$MAJOR_TAG"
@@ -0,0 +1,18 @@
1
+ name: Release Please
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+
7
+ permissions:
8
+ contents: write
9
+ pull-requests: write
10
+
11
+ jobs:
12
+ release-please:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: googleapis/release-please-action@v4
16
+ with:
17
+ config-file: release-please-config.json
18
+ manifest-file: .release-please-manifest.json
@@ -0,0 +1,32 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.egg-info/
6
+ .eggs/
7
+ dist/
8
+ build/
9
+ .venv/
10
+ venv/
11
+ .pytest_cache/
12
+ .ruff_cache/
13
+ .coverage
14
+ htmlcov/
15
+
16
+ # IDEs & OS
17
+ .vscode/
18
+ .idea/
19
+ .DS_Store
20
+ Thumbs.db
21
+
22
+ # Local-only planning and agent rules (kept out of public repo for now)
23
+ PRD.md
24
+ AGENTS.md
25
+ .agents/
26
+ docs/phases/
27
+ docs/README.md
28
+ docs/roadmap.md
29
+ docs/decisions.md
30
+ docs/architecture.md
31
+ docs/git-workflow.md
32
+ docs/validation-log.md
@@ -0,0 +1,13 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v5.0.0
4
+ hooks:
5
+ - id: trailing-whitespace
6
+ - id: end-of-file-fixer
7
+ - id: check-yaml
8
+ - repo: https://github.com/astral-sh/ruff-pre-commit
9
+ rev: v0.17.6
10
+ hooks:
11
+ - id: ruff-check
12
+ args: [--fix]
13
+ - id: ruff-format
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.1.0"
3
+ }
@@ -0,0 +1,30 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6
+
7
+ ## Our Standards
8
+
9
+ Examples of behavior that contributes to a positive environment include:
10
+
11
+ - Using welcoming and inclusive language
12
+ - Being respectful of differing viewpoints and experiences
13
+ - Gracefully accepting constructive criticism
14
+ - Focusing on what is best for the community
15
+ - Showing empathy towards other community members
16
+
17
+ Examples of unacceptable behavior include:
18
+
19
+ - Trolling, insulting or derogatory comments, and personal or political attacks
20
+ - Public or private harassment
21
+ - Publishing others' private information without explicit permission
22
+ - Other conduct which could reasonably be considered inappropriate in a professional setting
23
+
24
+ ## Enforcement
25
+
26
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainers via GitHub Issues or direct repository contact. All complaints will be reviewed and investigated promptly and fairly.
27
+
28
+ ## Attribution
29
+
30
+ This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.
@@ -0,0 +1,55 @@
1
+ # Contributing to diff2test
2
+
3
+ Thank you for helping improve **diff2test**! We welcome bug reports, documentation improvements, new language/framework profiles, and code contributions.
4
+
5
+ ## Development Setup
6
+
7
+ Requirements: **Python 3.10+** and `git`.
8
+
9
+ ```bash
10
+ git clone https://github.com/mehmetakifkucukkaya/diff2test.git
11
+ cd diff2test
12
+
13
+ python -m venv .venv
14
+ # Linux / macOS:
15
+ source .venv/bin/activate
16
+ # Windows (PowerShell):
17
+ .venv\Scripts\Activate.ps1
18
+
19
+ pip install -e ".[dev]"
20
+ pre-commit install
21
+ ```
22
+
23
+ ## Code Quality & Testing
24
+
25
+ Run all checks locally before committing:
26
+
27
+ ```bash
28
+ ruff check .
29
+ ruff format --check .
30
+ pytest --cov=diff2test
31
+ ```
32
+
33
+ ### Testing Rules
34
+
35
+ - Unit and integration tests **must run completely offline**. Never call real LLM APIs in unit tests.
36
+ - Use `pytest`'s `tmp_path`, `httpx.MockTransport`, and `tests.fakes.FakeLLMClient`.
37
+ - Live end-to-end tests (`tests/e2e/test_e2e_live.py`) are opt-in via `DIFF2TEST_RUN_LIVE_E2E=1`.
38
+
39
+ ## Branching & Commit Conventions
40
+
41
+ - Never push directly to `main`. Always create a short-lived branch from `main` (e.g., `feat/...`, `fix/...`, `docs/...`).
42
+ - Use [Conventional Commits](https://www.conventionalcommits.org/) in English (`feat:`, `fix:`, `docs:`, `test:`, `chore:`, `ci:`).
43
+ - Keep commits small and atomic, with passing `ruff` and `pytest` checks.
44
+
45
+ ## Adding a Profile
46
+
47
+ Want to add support for a new test framework (such as Vitest, Jest, `go test`, or `cargo test`)? See [docs/writing-profiles.md](docs/writing-profiles.md).
48
+
49
+ ## Pull Request Checklist
50
+
51
+ - [ ] Changes are scoped to a single feature or fix.
52
+ - [ ] New behavior is covered by offline `pytest` tests.
53
+ - [ ] `ruff check .` and `ruff format --check .` pass with zero warnings.
54
+ - [ ] `pytest` passes locally.
55
+ - [ ] Documentation is updated if CLI options, Action inputs, or config fields changed.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mehmet Akif
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.