git-auto-pro 1.0.0__py3-none-any.whl
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.
- git_auto_pro/__init__.py +5 -0
- git_auto_pro/backup.py +87 -0
- git_auto_pro/cli.py +474 -0
- git_auto_pro/config.py +100 -0
- git_auto_pro/git_commands.py +426 -0
- git_auto_pro/github.py +318 -0
- git_auto_pro/gitignore_manager.py +400 -0
- git_auto_pro/scaffolding/__init__.py +1 -0
- git_auto_pro/scaffolding/github_templates.py +635 -0
- git_auto_pro/scaffolding/gitignore.py +149 -0
- git_auto_pro/scaffolding/hooks.py +331 -0
- git_auto_pro/scaffolding/license.py +109 -0
- git_auto_pro/scaffolding/project.py +83 -0
- git_auto_pro/scaffolding/readme.py +109 -0
- git_auto_pro/scaffolding/templates.py +336 -0
- git_auto_pro/scaffolding/workflows.py +236 -0
- git_auto_pro-1.0.0.dist-info/METADATA +477 -0
- git_auto_pro-1.0.0.dist-info/RECORD +22 -0
- git_auto_pro-1.0.0.dist-info/WHEEL +5 -0
- git_auto_pro-1.0.0.dist-info/entry_points.txt +2 -0
- git_auto_pro-1.0.0.dist-info/licenses/LICENSE +0 -0
- git_auto_pro-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,635 @@
|
|
|
1
|
+
"""GitHub issue and PR template generator."""
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from rich.console import Console
|
|
5
|
+
|
|
6
|
+
console = Console()
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def generate_github_templates(type: str) -> None:
|
|
10
|
+
"""Generate GitHub issue/PR templates."""
|
|
11
|
+
console.print(f"[bold cyan]📋 Generating GitHub {type} template[/bold cyan]\n")
|
|
12
|
+
|
|
13
|
+
if type == "issue":
|
|
14
|
+
generate_issue_templates()
|
|
15
|
+
elif type == "pr":
|
|
16
|
+
generate_pr_template()
|
|
17
|
+
elif type == "contributing":
|
|
18
|
+
generate_contributing()
|
|
19
|
+
else:
|
|
20
|
+
console.print(f"[red]✗ Unknown template type: {type}[/red]")
|
|
21
|
+
console.print("[yellow]Available types: issue, pr, contributing[/yellow]")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def generate_issue_templates() -> None:
|
|
25
|
+
"""Generate issue templates."""
|
|
26
|
+
templates_dir = Path(".github/ISSUE_TEMPLATE")
|
|
27
|
+
templates_dir.mkdir(parents=True, exist_ok=True)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
(templates_dir / "bug_report.md").write_text(BUG_REPORT_TEMPLATE)
|
|
31
|
+
console.print(f"[green]✓ Created: {templates_dir / 'bug_report.md'}[/green]")
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
(templates_dir / "feature_request.md").write_text(FEATURE_REQUEST_TEMPLATE)
|
|
35
|
+
console.print(f"[green]✓ Created: {templates_dir / 'feature_request.md'}[/green]")
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
(templates_dir / "config.yml").write_text(ISSUE_CONFIG_TEMPLATE)
|
|
39
|
+
console.print(f"[green]✓ Created: {templates_dir / 'config.yml'}[/green]")
|
|
40
|
+
|
|
41
|
+
console.print("\n[bold green]✓ Issue templates generated successfully![/bold green]")
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
BUG_REPORT_TEMPLATE = """---
|
|
45
|
+
name: Bug Report
|
|
46
|
+
about: Create a report to help us improve
|
|
47
|
+
title: '[BUG] '
|
|
48
|
+
labels: bug
|
|
49
|
+
assignees: ''
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## 🐛 Bug Description
|
|
53
|
+
A clear and concise description of what the bug is.
|
|
54
|
+
|
|
55
|
+
## 📋 To Reproduce
|
|
56
|
+
Steps to reproduce the behavior:
|
|
57
|
+
1. Go to '...'
|
|
58
|
+
2. Click on '....'
|
|
59
|
+
3. Scroll down to '....'
|
|
60
|
+
4. See error
|
|
61
|
+
|
|
62
|
+
## ✅ Expected Behavior
|
|
63
|
+
A clear and concise description of what you expected to happen.
|
|
64
|
+
|
|
65
|
+
## 📸 Screenshots
|
|
66
|
+
If applicable, add screenshots to help explain your problem.
|
|
67
|
+
|
|
68
|
+
## 💻 Environment
|
|
69
|
+
**Desktop (please complete the following information):**
|
|
70
|
+
- OS: [e.g. Ubuntu 22.04, macOS 13.0, Windows 11]
|
|
71
|
+
- Python Version: [e.g. 3.10.5]
|
|
72
|
+
- Package Version: [e.g. 1.0.0]
|
|
73
|
+
- Git Version: [e.g. 2.40.0]
|
|
74
|
+
|
|
75
|
+
**Additional Environment Details:**
|
|
76
|
+
```bash
|
|
77
|
+
# Output of: git-auto version
|
|
78
|
+
# Output of: python --version
|
|
79
|
+
# Output of: git --version
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## 📝 Additional Context
|
|
83
|
+
Add any other context about the problem here.
|
|
84
|
+
|
|
85
|
+
## 🔍 Logs
|
|
86
|
+
If applicable, add relevant logs or error messages:
|
|
87
|
+
```
|
|
88
|
+
Paste error logs here
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## ✔️ Possible Solution
|
|
92
|
+
If you have suggestions on how to fix the bug, please describe them here.
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
FEATURE_REQUEST_TEMPLATE = """---
|
|
97
|
+
name: Feature Request
|
|
98
|
+
about: Suggest an idea for this project
|
|
99
|
+
title: '[FEATURE] '
|
|
100
|
+
labels: enhancement
|
|
101
|
+
assignees: ''
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## 🚀 Feature Description
|
|
105
|
+
A clear and concise description of the feature you'd like to see.
|
|
106
|
+
|
|
107
|
+
## 🎯 Problem Statement
|
|
108
|
+
**Is your feature request related to a problem? Please describe.**
|
|
109
|
+
A clear and concise description of what the problem is.
|
|
110
|
+
Ex. I'm always frustrated when [...]
|
|
111
|
+
|
|
112
|
+
## 💡 Proposed Solution
|
|
113
|
+
**Describe the solution you'd like**
|
|
114
|
+
A clear and concise description of what you want to happen.
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# Example of how the feature would be used
|
|
118
|
+
git-auto new-command --option value
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## 🔄 Alternatives Considered
|
|
122
|
+
**Describe alternatives you've considered**
|
|
123
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
|
124
|
+
|
|
125
|
+
## 📊 Additional Context
|
|
126
|
+
Add any other context, mockups, or screenshots about the feature request here.
|
|
127
|
+
|
|
128
|
+
## ✅ Acceptance Criteria
|
|
129
|
+
What needs to be true for this feature to be considered complete?
|
|
130
|
+
- [ ] Criterion 1
|
|
131
|
+
- [ ] Criterion 2
|
|
132
|
+
- [ ] Criterion 3
|
|
133
|
+
|
|
134
|
+
## 🎨 Would you like to implement this feature?
|
|
135
|
+
- [ ] Yes, I'd like to work on this
|
|
136
|
+
- [ ] No, just suggesting
|
|
137
|
+
- [ ] Need guidance on how to implement
|
|
138
|
+
|
|
139
|
+
## 📌 Priority
|
|
140
|
+
How important is this feature to you?
|
|
141
|
+
- [ ] Critical - Blocking my work
|
|
142
|
+
- [ ] High - Would significantly improve my workflow
|
|
143
|
+
- [ ] Medium - Nice to have
|
|
144
|
+
- [ ] Low - Minor improvement
|
|
145
|
+
"""
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
ISSUE_CONFIG_TEMPLATE = """blank_issues_enabled: false
|
|
149
|
+
contact_links:
|
|
150
|
+
- name: 💬 Discussions
|
|
151
|
+
url: https://github.com/yourusername/git-auto-pro/discussions
|
|
152
|
+
about: Ask questions and discuss ideas with the community
|
|
153
|
+
- name: 📚 Documentation
|
|
154
|
+
url: https://github.com/yourusername/git-auto-pro#readme
|
|
155
|
+
about: Read the documentation for usage guides and examples
|
|
156
|
+
"""
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def generate_pr_template() -> None:
|
|
160
|
+
"""Generate pull request template."""
|
|
161
|
+
github_dir = Path(".github")
|
|
162
|
+
github_dir.mkdir(exist_ok=True)
|
|
163
|
+
|
|
164
|
+
pr_file = github_dir / "PULL_REQUEST_TEMPLATE.md"
|
|
165
|
+
pr_file.write_text(PR_TEMPLATE)
|
|
166
|
+
|
|
167
|
+
console.print(f"[green]✓ Created: {pr_file}[/green]")
|
|
168
|
+
console.print("\n[bold green]✓ PR template generated successfully![/bold green]")
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
PR_TEMPLATE = """## 📝 Description
|
|
172
|
+
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
|
|
173
|
+
|
|
174
|
+
Fixes # (issue)
|
|
175
|
+
Closes # (issue)
|
|
176
|
+
|
|
177
|
+
## 🔧 Type of Change
|
|
178
|
+
Please delete options that are not relevant.
|
|
179
|
+
|
|
180
|
+
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
|
|
181
|
+
- [ ] ✨ New feature (non-breaking change which adds functionality)
|
|
182
|
+
- [ ] 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
|
183
|
+
- [ ] 📚 Documentation update
|
|
184
|
+
- [ ] 🎨 Style update (formatting, renaming)
|
|
185
|
+
- [ ] ♻️ Code refactoring (no functional changes)
|
|
186
|
+
- [ ] ⚡ Performance improvement
|
|
187
|
+
- [ ] ✅ Test update
|
|
188
|
+
- [ ] 🔨 Build/CI update
|
|
189
|
+
- [ ] 📦 Dependency update
|
|
190
|
+
|
|
191
|
+
## 🧪 How Has This Been Tested?
|
|
192
|
+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
|
|
193
|
+
|
|
194
|
+
**Test Configuration**:
|
|
195
|
+
* Python version:
|
|
196
|
+
* OS:
|
|
197
|
+
* Git version:
|
|
198
|
+
|
|
199
|
+
**Tests performed:**
|
|
200
|
+
- [ ] Unit tests pass
|
|
201
|
+
- [ ] Integration tests pass
|
|
202
|
+
- [ ] Manual testing completed
|
|
203
|
+
|
|
204
|
+
## 📸 Screenshots (if appropriate)
|
|
205
|
+
Add screenshots to help reviewers understand your changes.
|
|
206
|
+
|
|
207
|
+
## ✅ Checklist
|
|
208
|
+
Please check all that apply:
|
|
209
|
+
|
|
210
|
+
### Code Quality
|
|
211
|
+
- [ ] My code follows the style guidelines of this project (PEP 8)
|
|
212
|
+
- [ ] I have performed a self-review of my own code
|
|
213
|
+
- [ ] I have commented my code, particularly in hard-to-understand areas
|
|
214
|
+
- [ ] My code passes all linting checks (black, ruff)
|
|
215
|
+
- [ ] My code passes type checking (mypy)
|
|
216
|
+
|
|
217
|
+
### Documentation
|
|
218
|
+
- [ ] I have made corresponding changes to the documentation
|
|
219
|
+
- [ ] I have updated the README if needed
|
|
220
|
+
- [ ] I have added docstrings to new functions/classes
|
|
221
|
+
- [ ] I have updated the CHANGELOG.md
|
|
222
|
+
|
|
223
|
+
### Testing
|
|
224
|
+
- [ ] My changes generate no new warnings
|
|
225
|
+
- [ ] I have added tests that prove my fix is effective or that my feature works
|
|
226
|
+
- [ ] New and existing unit tests pass locally with my changes
|
|
227
|
+
- [ ] I have checked my code for edge cases
|
|
228
|
+
|
|
229
|
+
### Dependencies
|
|
230
|
+
- [ ] I have checked that no new dependencies are added unnecessarily
|
|
231
|
+
- [ ] If dependencies are added, I have justified them in this PR
|
|
232
|
+
|
|
233
|
+
## 🔗 Related Issues/PRs
|
|
234
|
+
List any related issues or pull requests:
|
|
235
|
+
- Related to #
|
|
236
|
+
- Depends on #
|
|
237
|
+
- Blocks #
|
|
238
|
+
|
|
239
|
+
## 📌 Additional Notes
|
|
240
|
+
Add any additional notes for reviewers here.
|
|
241
|
+
|
|
242
|
+
## 🎯 Post-Merge Actions
|
|
243
|
+
What should happen after this PR is merged?
|
|
244
|
+
- [ ] Update documentation site
|
|
245
|
+
- [ ] Announce in discussions
|
|
246
|
+
- [ ] Create release
|
|
247
|
+
- [ ] Update examples
|
|
248
|
+
- [ ] None
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
**Reviewer Guidelines:**
|
|
253
|
+
- Verify all checklist items are completed
|
|
254
|
+
- Test the changes locally if possible
|
|
255
|
+
- Check for potential breaking changes
|
|
256
|
+
- Ensure documentation is updated
|
|
257
|
+
- Verify tests are comprehensive
|
|
258
|
+
"""
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
def generate_contributing() -> None:
|
|
262
|
+
"""Generate CONTRIBUTING.md."""
|
|
263
|
+
contributing_file = Path("CONTRIBUTING.md")
|
|
264
|
+
contributing_file.write_text(CONTRIBUTING_TEMPLATE)
|
|
265
|
+
|
|
266
|
+
console.print(f"[green]✓ Created: {contributing_file}[/green]")
|
|
267
|
+
console.print("\n[bold green]✓ CONTRIBUTING.md generated successfully![/bold green]")
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
CONTRIBUTING_TEMPLATE = """# 🤝 Contributing to Git-Auto Pro
|
|
271
|
+
|
|
272
|
+
Thank you for your interest in contributing to Git-Auto Pro! We welcome contributions from everyone.
|
|
273
|
+
|
|
274
|
+
## 📋 Table of Contents
|
|
275
|
+
|
|
276
|
+
- [Code of Conduct](#code-of-conduct)
|
|
277
|
+
- [Getting Started](#getting-started)
|
|
278
|
+
- [Development Setup](#development-setup)
|
|
279
|
+
- [How to Contribute](#how-to-contribute)
|
|
280
|
+
- [Coding Standards](#coding-standards)
|
|
281
|
+
- [Testing](#testing)
|
|
282
|
+
- [Pull Request Process](#pull-request-process)
|
|
283
|
+
- [Reporting Bugs](#reporting-bugs)
|
|
284
|
+
- [Suggesting Features](#suggesting-features)
|
|
285
|
+
- [Questions](#questions)
|
|
286
|
+
|
|
287
|
+
## 📜 Code of Conduct
|
|
288
|
+
|
|
289
|
+
This project adheres to a code of conduct. By participating, you are expected to uphold this code. Please be respectful and constructive in all interactions.
|
|
290
|
+
|
|
291
|
+
### Our Standards
|
|
292
|
+
|
|
293
|
+
- **Be Respectful**: Treat everyone with respect and kindness
|
|
294
|
+
- **Be Constructive**: Provide helpful feedback and suggestions
|
|
295
|
+
- **Be Collaborative**: Work together to improve the project
|
|
296
|
+
- **Be Patient**: Remember that everyone is learning
|
|
297
|
+
|
|
298
|
+
## 🚀 Getting Started
|
|
299
|
+
|
|
300
|
+
1. **Fork the repository** on GitHub
|
|
301
|
+
2. **Clone your fork** locally
|
|
302
|
+
3. **Create a branch** for your changes
|
|
303
|
+
4. **Make your changes**
|
|
304
|
+
5. **Test your changes**
|
|
305
|
+
6. **Submit a pull request**
|
|
306
|
+
|
|
307
|
+
## 🛠️ Development Setup
|
|
308
|
+
|
|
309
|
+
### Prerequisites
|
|
310
|
+
|
|
311
|
+
- Python 3.8 or higher
|
|
312
|
+
- Git
|
|
313
|
+
- GitHub account
|
|
314
|
+
|
|
315
|
+
### Setup Steps
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
# Clone your fork
|
|
319
|
+
git clone https://github.com/YOUR_USERNAME/git-auto-pro.git
|
|
320
|
+
cd git-auto-pro
|
|
321
|
+
|
|
322
|
+
# Create virtual environment
|
|
323
|
+
python -m venv venv
|
|
324
|
+
|
|
325
|
+
# Activate virtual environment
|
|
326
|
+
source venv/bin/activate # On Windows: venv\\Scripts\\activate
|
|
327
|
+
|
|
328
|
+
# Install dependencies
|
|
329
|
+
pip install -e ".[dev]"
|
|
330
|
+
|
|
331
|
+
# Verify installation
|
|
332
|
+
git-auto --help
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### Development Dependencies
|
|
336
|
+
|
|
337
|
+
```bash
|
|
338
|
+
# Core dependencies (automatically installed)
|
|
339
|
+
typer[all]
|
|
340
|
+
requests
|
|
341
|
+
keyring
|
|
342
|
+
rich
|
|
343
|
+
gitpython
|
|
344
|
+
pyyaml
|
|
345
|
+
questionary
|
|
346
|
+
|
|
347
|
+
# Development dependencies
|
|
348
|
+
pytest
|
|
349
|
+
pytest-cov
|
|
350
|
+
black
|
|
351
|
+
ruff
|
|
352
|
+
mypy
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
## 💻 How to Contribute
|
|
356
|
+
|
|
357
|
+
### Types of Contributions
|
|
358
|
+
|
|
359
|
+
We welcome various types of contributions:
|
|
360
|
+
|
|
361
|
+
1. **🐛 Bug Fixes**: Fix issues in existing code
|
|
362
|
+
2. **✨ New Features**: Add new functionality
|
|
363
|
+
3. **📚 Documentation**: Improve or add documentation
|
|
364
|
+
4. **🧪 Tests**: Add or improve test coverage
|
|
365
|
+
5. **🎨 Code Quality**: Refactor or improve code quality
|
|
366
|
+
6. **🌐 Translations**: Help translate the tool
|
|
367
|
+
|
|
368
|
+
### First-Time Contributors
|
|
369
|
+
|
|
370
|
+
Look for issues labeled:
|
|
371
|
+
- `good first issue` - Easy issues for beginners
|
|
372
|
+
- `help wanted` - Issues where we need help
|
|
373
|
+
- `documentation` - Documentation improvements
|
|
374
|
+
|
|
375
|
+
## 📏 Coding Standards
|
|
376
|
+
|
|
377
|
+
### Python Style Guide
|
|
378
|
+
|
|
379
|
+
We follow [PEP 8](https://pep8.org/) with some modifications:
|
|
380
|
+
|
|
381
|
+
- **Line Length**: 100 characters (not 79)
|
|
382
|
+
- **String Quotes**: Use double quotes for strings
|
|
383
|
+
- **Type Hints**: Always use type hints for function parameters and return values
|
|
384
|
+
|
|
385
|
+
### Code Formatting
|
|
386
|
+
|
|
387
|
+
```bash
|
|
388
|
+
# Format code with Black
|
|
389
|
+
black git_auto_pro/ tests/
|
|
390
|
+
|
|
391
|
+
# Lint with Ruff
|
|
392
|
+
ruff check git_auto_pro/ tests/
|
|
393
|
+
|
|
394
|
+
# Fix linting issues automatically
|
|
395
|
+
ruff check git_auto_pro/ tests/ --fix
|
|
396
|
+
|
|
397
|
+
# Type checking with mypy
|
|
398
|
+
mypy git_auto_pro/
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
### Docstring Format
|
|
402
|
+
|
|
403
|
+
Use Google-style docstrings:
|
|
404
|
+
|
|
405
|
+
```python
|
|
406
|
+
def example_function(param1: str, param2: int) -> bool:
|
|
407
|
+
'''Brief description of function.
|
|
408
|
+
|
|
409
|
+
Detailed description if needed.
|
|
410
|
+
|
|
411
|
+
Args:
|
|
412
|
+
param1: Description of param1
|
|
413
|
+
param2: Description of param2
|
|
414
|
+
|
|
415
|
+
Returns:
|
|
416
|
+
Description of return value
|
|
417
|
+
|
|
418
|
+
Raises:
|
|
419
|
+
ValueError: When param2 is negative
|
|
420
|
+
|
|
421
|
+
Example:
|
|
422
|
+
>>> example_function("test", 5)
|
|
423
|
+
True
|
|
424
|
+
'''
|
|
425
|
+
pass
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
### File Organization
|
|
429
|
+
|
|
430
|
+
- One class per file when possible
|
|
431
|
+
- Related functions grouped together
|
|
432
|
+
- Clear separation of concerns
|
|
433
|
+
- Imports organized: stdlib, third-party, local
|
|
434
|
+
|
|
435
|
+
## 🧪 Testing
|
|
436
|
+
|
|
437
|
+
### Running Tests
|
|
438
|
+
|
|
439
|
+
```bash
|
|
440
|
+
# Run all tests
|
|
441
|
+
pytest
|
|
442
|
+
|
|
443
|
+
# Run with coverage
|
|
444
|
+
pytest --cov=git_auto_pro --cov-report=html
|
|
445
|
+
|
|
446
|
+
# Run specific test file
|
|
447
|
+
pytest tests/test_cli.py
|
|
448
|
+
|
|
449
|
+
# Run specific test
|
|
450
|
+
pytest tests/test_cli.py::test_login
|
|
451
|
+
|
|
452
|
+
# Run with verbose output
|
|
453
|
+
pytest -v
|
|
454
|
+
|
|
455
|
+
# Run tests in parallel
|
|
456
|
+
pytest -n auto
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
### Writing Tests
|
|
460
|
+
|
|
461
|
+
- Write tests for all new features
|
|
462
|
+
- Maintain or improve code coverage (target: >80%)
|
|
463
|
+
- Use descriptive test names
|
|
464
|
+
- Use fixtures for common setup
|
|
465
|
+
- Mock external dependencies (GitHub API, Git operations)
|
|
466
|
+
|
|
467
|
+
Example test:
|
|
468
|
+
|
|
469
|
+
```python
|
|
470
|
+
import pytest
|
|
471
|
+
from git_auto_pro.config import get_config, set_config
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
def test_config_set_and_get():
|
|
475
|
+
'''Test setting and getting configuration values.'''
|
|
476
|
+
# Arrange
|
|
477
|
+
key = "test_key"
|
|
478
|
+
value = "test_value"
|
|
479
|
+
|
|
480
|
+
# Act
|
|
481
|
+
set_config(key, value)
|
|
482
|
+
result = get_config(key)
|
|
483
|
+
|
|
484
|
+
# Assert
|
|
485
|
+
assert result == value
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
@pytest.fixture
|
|
489
|
+
def temp_repo(tmp_path):
|
|
490
|
+
'''Create a temporary Git repository for testing.'''
|
|
491
|
+
import git
|
|
492
|
+
repo = git.Repo.init(tmp_path)
|
|
493
|
+
return repo
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
## 🔄 Pull Request Process
|
|
497
|
+
|
|
498
|
+
### Before Submitting
|
|
499
|
+
|
|
500
|
+
1. **Update your fork**: `git pull upstream main`
|
|
501
|
+
2. **Create a branch**: `git checkout -b feature/your-feature-name`
|
|
502
|
+
3. **Make changes**: Edit code
|
|
503
|
+
4. **Run tests**: Ensure all tests pass
|
|
504
|
+
5. **Format code**: Run black and ruff
|
|
505
|
+
6. **Update docs**: Update README/docs if needed
|
|
506
|
+
7. **Commit changes**: Use conventional commits
|
|
507
|
+
|
|
508
|
+
### Commit Message Format
|
|
509
|
+
|
|
510
|
+
We use [Conventional Commits](https://www.conventionalcommits.org/):
|
|
511
|
+
|
|
512
|
+
```
|
|
513
|
+
<type>(<scope>): <subject>
|
|
514
|
+
|
|
515
|
+
<body>
|
|
516
|
+
|
|
517
|
+
<footer>
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
**Types:**
|
|
521
|
+
- `feat`: New feature
|
|
522
|
+
- `fix`: Bug fix
|
|
523
|
+
- `docs`: Documentation changes
|
|
524
|
+
- `style`: Code style changes (formatting)
|
|
525
|
+
- `refactor`: Code refactoring
|
|
526
|
+
- `test`: Test changes
|
|
527
|
+
- `chore`: Maintenance tasks
|
|
528
|
+
- `perf`: Performance improvements
|
|
529
|
+
|
|
530
|
+
**Examples:**
|
|
531
|
+
```bash
|
|
532
|
+
feat(cli): add support for custom templates
|
|
533
|
+
fix(github): handle API rate limiting correctly
|
|
534
|
+
docs(readme): update installation instructions
|
|
535
|
+
test(config): add tests for configuration management
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
### Submitting a Pull Request
|
|
539
|
+
|
|
540
|
+
1. **Push your branch**: `git push origin feature/your-feature-name`
|
|
541
|
+
2. **Open PR**: Go to GitHub and create a pull request
|
|
542
|
+
3. **Fill out template**: Complete the PR template
|
|
543
|
+
4. **Link issues**: Reference related issues
|
|
544
|
+
5. **Request review**: Wait for maintainer review
|
|
545
|
+
6. **Address feedback**: Make requested changes
|
|
546
|
+
7. **Merge**: Once approved, your PR will be merged
|
|
547
|
+
|
|
548
|
+
### PR Checklist
|
|
549
|
+
|
|
550
|
+
Before submitting, ensure:
|
|
551
|
+
|
|
552
|
+
- [ ] Code follows style guidelines
|
|
553
|
+
- [ ] Tests pass locally
|
|
554
|
+
- [ ] New tests added for new features
|
|
555
|
+
- [ ] Documentation updated
|
|
556
|
+
- [ ] Commit messages follow convention
|
|
557
|
+
- [ ] No merge conflicts
|
|
558
|
+
- [ ] PR description is complete
|
|
559
|
+
|
|
560
|
+
## 🐛 Reporting Bugs
|
|
561
|
+
|
|
562
|
+
### Before Reporting
|
|
563
|
+
|
|
564
|
+
1. **Check existing issues**: Search for similar issues
|
|
565
|
+
2. **Try latest version**: Update to the latest version
|
|
566
|
+
3. **Reproduce**: Ensure you can reproduce the bug
|
|
567
|
+
4. **Gather info**: Collect relevant information
|
|
568
|
+
|
|
569
|
+
### Bug Report Template
|
|
570
|
+
|
|
571
|
+
Use the bug report template when creating an issue. Include:
|
|
572
|
+
|
|
573
|
+
- Clear description of the bug
|
|
574
|
+
- Steps to reproduce
|
|
575
|
+
- Expected vs actual behavior
|
|
576
|
+
- Environment details (OS, Python version, etc.)
|
|
577
|
+
- Error messages or logs
|
|
578
|
+
- Screenshots if applicable
|
|
579
|
+
|
|
580
|
+
## 💡 Suggesting Features
|
|
581
|
+
|
|
582
|
+
### Before Suggesting
|
|
583
|
+
|
|
584
|
+
1. **Check existing issues**: See if it's already suggested
|
|
585
|
+
2. **Consider scope**: Is it aligned with project goals?
|
|
586
|
+
3. **Think about implementation**: How might it work?
|
|
587
|
+
|
|
588
|
+
### Feature Request Template
|
|
589
|
+
|
|
590
|
+
Use the feature request template. Include:
|
|
591
|
+
|
|
592
|
+
- Clear description of the feature
|
|
593
|
+
- Problem it solves
|
|
594
|
+
- Proposed solution
|
|
595
|
+
- Alternatives considered
|
|
596
|
+
- Example usage
|
|
597
|
+
|
|
598
|
+
## ❓ Questions
|
|
599
|
+
|
|
600
|
+
### Where to Ask
|
|
601
|
+
|
|
602
|
+
- **GitHub Discussions**: For general questions and discussions
|
|
603
|
+
- **GitHub Issues**: For bugs and feature requests only
|
|
604
|
+
- **Email**: For private inquiries
|
|
605
|
+
|
|
606
|
+
### Getting Help
|
|
607
|
+
|
|
608
|
+
1. Check the [README](README.md)
|
|
609
|
+
2. Read the [Setup Guide](SETUP_GUIDE.md)
|
|
610
|
+
3. Search existing issues and discussions
|
|
611
|
+
4. Ask in GitHub Discussions
|
|
612
|
+
|
|
613
|
+
## 🏆 Recognition
|
|
614
|
+
|
|
615
|
+
Contributors will be:
|
|
616
|
+
- Listed in CONTRIBUTORS.md
|
|
617
|
+
- Mentioned in release notes
|
|
618
|
+
- Credited in documentation
|
|
619
|
+
|
|
620
|
+
## 📞 Contact
|
|
621
|
+
|
|
622
|
+
- **GitHub**: [github.com/yourusername/git-auto-pro](https://github.com/yourusername/git-auto-pro)
|
|
623
|
+
- **Issues**: [github.com/yourusername/git-auto-pro/issues](https://github.com/yourusername/git-auto-pro/issues)
|
|
624
|
+
- **Discussions**: [github.com/yourusername/git-auto-pro/discussions](https://github.com/yourusername/git-auto-pro/discussions)
|
|
625
|
+
|
|
626
|
+
## 📄 License
|
|
627
|
+
|
|
628
|
+
By contributing, you agree that your contributions will be licensed under the MIT License.
|
|
629
|
+
|
|
630
|
+
---
|
|
631
|
+
|
|
632
|
+
Thank you for contributing to Git-Auto Pro! 🚀
|
|
633
|
+
|
|
634
|
+
**Happy coding!** ✨
|
|
635
|
+
"""
|