Skip to content

Commit 801e904

Browse files
author
Your Name
committed
Enhance project structure: update .gitignore, add development guide, and create issue/pull request templates
1 parent 674dfc8 commit 801e904

6 files changed

Lines changed: 313 additions & 20 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve
4+
title: "[BUG] "
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
## Describe the Bug
11+
A clear and concise description of what the bug is.
12+
13+
## To Reproduce
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Run '...'
17+
3. See error
18+
19+
## Expected Behavior
20+
A clear and concise description of what you expected to happen.
21+
22+
## Actual Behavior
23+
What actually happened instead.
24+
25+
## Environment
26+
- Python Version: [e.g. 3.11.0]
27+
- OS: [e.g. Ubuntu 22.04, Windows 11]
28+
- Script Name: [e.g. myScript.py]
29+
30+
## Screenshots
31+
If applicable, add screenshots or error messages.
32+
33+
## Additional Context
34+
Add any other context about the problem here.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for this project
4+
title: "[FEATURE] "
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
## Is your feature request related to a problem?
11+
A clear and concise description of what the problem is.
12+
13+
## Describe the Solution
14+
A clear and concise description of what you want to happen.
15+
16+
## Describe Alternatives
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
## Additional Context
20+
Add any other context or screenshots about the feature request here.
21+
22+
## Complexity
23+
- [ ] Simple (< 50 lines)
24+
- [ ] Medium (50-200 lines)
25+
- [ ] Complex (> 200 lines)

.github/pull_request_template.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## Description
2+
Please include a summary of the changes and related context. Explain the problem you're solving or feature you're adding.
3+
4+
## Type of Change
5+
- [ ] Bug fix (non-breaking change which fixes an issue)
6+
- [ ] New feature (non-breaking change which adds functionality)
7+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
8+
- [ ] Documentation update
9+
- [ ] Code cleanup/refactoring
10+
11+
## Related Issues
12+
Closes #(issue number)
13+
14+
## Testing
15+
Please describe the tests you've run to verify your changes:
16+
- [ ] Manual testing
17+
- [ ] Added automated tests
18+
- [ ] Existing tests pass
19+
20+
## Checklist
21+
- [ ] My code follows the project's code style
22+
- [ ] I have commented my code, particularly in hard-to-understand areas
23+
- [ ] I have updated the README.md if needed
24+
- [ ] My changes generate no new warnings
25+
- [ ] I have tested my code locally
26+
- [ ] New and existing tests pass with my changes
27+
28+
## Screenshots (if applicable)
29+
Add screenshots or demos of your changes if relevant.

.gitignore

Lines changed: 56 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,61 @@
1-
.idea
2-
*.pyc
3-
string=sorted(input())
4-
lower=""
5-
even=""
6-
odd=""
7-
upper=""
8-
for i in string:
9-
if i.islower():
10-
lower+=i
11-
elif i.isupper():
12-
upper+=i
13-
elif int(i)%2==0:
14-
even+=i
15-
else:
16-
odd+=i
17-
print(lower+upper+odd+even)
1+
# IDE
2+
.idea/
3+
.vscode/
4+
*.swp
5+
*.swo
6+
*~
7+
.DS_Store
8+
Thumbs.db
189

19-
.vscode
10+
# Python
2011
__pycache__/
12+
*.pyc
13+
*.pyo
14+
*.pyd
15+
.Python
16+
env/
2117
.venv
18+
venv/
19+
ENV/
20+
build/
21+
develop-eggs/
22+
dist/
23+
downloads/
24+
eggs/
25+
.eggs/
26+
lib/
27+
lib64/
28+
parts/
29+
sdist/
30+
var/
31+
wheels/
32+
*.egg-info/
33+
.installed.cfg
34+
*.egg
35+
36+
# Testing
37+
.pytest_cache/
38+
.coverage
39+
htmlcov/
40+
.tox/
2241

23-
*.DS_Store
42+
# Virtual environments
43+
venv/
44+
env/
45+
ENV/
46+
47+
# Database files
48+
*.db
49+
*.sqlite
50+
*.sqlite3
51+
52+
# OS files
53+
.DS_Store
2454
Thumbs.db
25-
bankmanaging.db
55+
desktop.ini
56+
57+
# Project specific
58+
.mypy_cache/
59+
.dmypy.json
60+
dmypy.json
61+
*.log

DEVELOPMENT.md

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# Development Guide
2+
3+
Welcome to geek-computers Python repository! This guide will help you set up your development environment and contribute to the project.
4+
5+
## Prerequisites
6+
7+
- Python 3.10+ (we test against 3.10, 3.11, and 3.12)
8+
- pip (Python package manager)
9+
- git
10+
11+
## Setup
12+
13+
### 1. Clone the Repository
14+
```bash
15+
git clone https://github.com/geekcomputers/Python.git
16+
cd Python
17+
```
18+
19+
### 2. Create Virtual Environment
20+
```bash
21+
# On Linux/Mac
22+
python3 -m venv venv
23+
source venv/bin/activate
24+
25+
# On Windows
26+
python -m venv venv
27+
venv\Scripts\activate
28+
```
29+
30+
### 3. Install Dependencies
31+
```bash
32+
pip install --upgrade pip
33+
pip install -r requirements.txt
34+
```
35+
36+
### 4. Install Development Tools
37+
```bash
38+
pip install ruff bandit mypy pytest codespell
39+
```
40+
41+
## Code Quality Checks
42+
43+
Before submitting a PR, run these checks locally:
44+
45+
### Run Codespell (spell checking)
46+
```bash
47+
codespell --skip "*.json,*.txt,*.pdf,*.md"
48+
```
49+
50+
### Run Bandit (security analysis)
51+
```bash
52+
bandit -r . --skip B101,B105
53+
```
54+
55+
### Run Ruff (linting)
56+
```bash
57+
ruff check .
58+
```
59+
60+
### Run Pytest (unit tests)
61+
```bash
62+
pytest
63+
```
64+
65+
### Run MyPy (type checking)
66+
```bash
67+
mypy . --ignore-missing-imports
68+
```
69+
70+
## Writing Scripts
71+
72+
When adding new scripts:
73+
74+
1. **Use clear, descriptive names** - `calculate_fibonacci.py` instead of `test.py`
75+
2. **Add docstrings** - Describe what your script does
76+
3. **Include comments** - Explain complex logic
77+
4. **Use type hints** (where applicable) - Helps with code clarity
78+
5. **Test your code** - Run it locally before submitting
79+
80+
### Example Script Template
81+
```python
82+
"""
83+
Module Name: Calculate Fibonacci Sequence
84+
Description: Generate Fibonacci numbers up to N
85+
Author: Your Name
86+
Date: YYYY-MM-DD
87+
"""
88+
89+
def fibonacci(n: int) -> list[int]:
90+
"""
91+
Generate Fibonacci sequence up to nth number.
92+
93+
Args:
94+
n: Number of Fibonacci numbers to generate
95+
96+
Returns:
97+
List of Fibonacci numbers
98+
"""
99+
if n <= 0:
100+
return []
101+
elif n == 1:
102+
return [0]
103+
104+
fib = [0, 1]
105+
for i in range(2, n):
106+
fib.append(fib[i-1] + fib[i-2])
107+
return fib
108+
109+
110+
if __name__ == "__main__":
111+
result = fibonacci(10)
112+
print(result)
113+
```
114+
115+
## Submission Process
116+
117+
1. **Create a feature branch** - `git checkout -b feature/your-feature-name`
118+
2. **Make your changes** - Add or modify scripts
119+
3. **Run quality checks** - Use the commands above
120+
4. **Commit your changes** - Use clear commit messages
121+
5. **Push to your fork** - `git push origin feature/your-feature-name`
122+
6. **Create a Pull Request** - Include description and testing info
123+
124+
## Pull Request Guidelines
125+
126+
- Keep PRs focused on a single feature or fix
127+
- Update README.md if adding new scripts
128+
- Reference any related issues with "Closes #123"
129+
- Follow the pull request template
130+
131+
## Common Issues
132+
133+
### ImportError for dependencies
134+
Make sure you've activated the virtual environment and installed all requirements:
135+
```bash
136+
source venv/bin/activate # Linux/Mac
137+
pip install -r requirements.txt
138+
```
139+
140+
### Tests fail locally but not in CI
141+
Check your Python version - we test on 3.10, 3.11, and 3.12:
142+
```bash
143+
python --version
144+
```
145+
146+
### Code style issues
147+
Run ruff with auto-fix:
148+
```bash
149+
ruff check . --fix
150+
```
151+
152+
## Need Help?
153+
154+
- Check existing [issues](https://github.com/geekcomputers/Python/issues)
155+
- Review the [README.md](README.md) for script documentation
156+
- Email: craig@geekcomputers.co.uk
157+
158+
Happy coding! 🐍

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#This is a new repo
22
# My Python Eggs 🐍 😄
33

4+
[![Python Checks](https://github.com/geekcomputers/Python/actions/workflows/python.yml/badge.svg)](https://github.com/geekcomputers/Python/actions/workflows/python.yml)
5+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6+
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
7+
48
<hr>
59

610
I do not consider myself as a programmer. I create these little programs as experiments to play with Python, or to solve problems for myself. I would gladly accept pointers from others to improve, simplify, or make the code more efficient. If you would like to make any comments then please feel free to email me: craig@geekcomputers.co.uk.
@@ -11,6 +15,13 @@ This repository contains a collection of Python scripts that are designed to red
1115

1216
Feel free to explore the scripts and use them for your learning and automation needs!
1317

18+
## Getting Started
19+
20+
- **New Contributors?** Check out [DEVELOPMENT.md](DEVELOPMENT.md) for setup instructions
21+
- **Want to contribute?** Read our [CONTRIBUTING.md](CONTRIBUTING.md) guidelines
22+
- **Found a bug?** Open an [issue](https://github.com/geekcomputers/Python/issues/new?assignees=&labels=bug&template=bug_report.md)
23+
- **Have an idea?** Suggest a [feature](https://github.com/geekcomputers/Python/issues/new?assignees=&labels=enhancement&template=feature_request.md)
24+
1425
## List of Scripts:
1526

1627
1. [batch_file_rename.py](https://github.com/geekcomputers/Python/blob/master/batch_file_rename.py) - Batch rename a group of files in a specified directory, changing their extensions.

0 commit comments

Comments
 (0)