Thank you for your interest in contributing to Duplicate File Remover! This document provides guidelines and instructions for contributing.
This project and everyone participating in it is governed by our commitment to:
- Be respectful and inclusive
- Welcome newcomers and help them learn
- Focus on constructive feedback
- Accept responsibility for our mistakes
Before creating a bug report, please:
- Check the existing issues to avoid duplicates
- Use the latest version to verify the bug still exists
When reporting a bug, include:
- Clear title - Summarize the issue
- Description - Explain what happened vs what you expected
- Steps to reproduce - Numbered list of actions
- Environment - Windows version, Python version
- Screenshots - If applicable
- Error messages - Copy-paste any error text
Template:
**Bug Description:**
[Clear description]
**Steps to Reproduce:**
1. Go to '...'
2. Click on '...'
3. See error
**Expected Behavior:**
[What you expected]
**Actual Behavior:**
[What actually happened]
**Environment:**
- OS: [e.g., Windows 10 22H2]
- Python: [e.g., 3.10.4]
- App Version: [e.g., 1.3.0]
**Screenshots:**
[If applicable]Feature requests are welcome! Please:
- Check if the feature has already been requested
- Provide a clear use case
- Explain why it would benefit users
Template:
**Feature Request:**
[Clear description]
**Use Case:**
[How would you use this?]
**Proposed Solution:**
[Your idea for implementation]
**Alternatives:**
[Other approaches you've considered]-
Fork the repository
git clone https://github.com/YOUR_USERNAME/DuplicateFileRemover.git cd DuplicateFileRemover -
Create a branch
git checkout -b feature/your-feature-name # or git checkout -b fix/issue-description -
Make your changes
- Follow the code style (see below)
- Add comments for complex logic
- Update documentation if needed
-
Test your changes
- Run the application and verify it works
- Test on different file types and sizes
- Test edge cases
-
Commit your changes
git add . git commit -m "feat: add new feature"
Commit message format:
feat:- New featurefix:- Bug fixdocs:- Documentation changesstyle:- Code style changes (formatting)refactor:- Code refactoringtest:- Adding testschore:- Maintenance tasks
-
Push and create PR
git push origin feature/your-feature-name
Then create a Pull Request on GitHub.
- Python 3.7 or higher
- Windows 7 SP1 or higher
- Git
# Clone your fork
git clone https://github.com/YOUR_USERNAME/DuplicateFileRemover.git
cd DuplicateFileRemover
# Create virtual environment (recommended)
python -m venv venv
venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run the application
python duplicate_file_remover.pyFollow PEP 8 with these specifics:
- Indentation: 4 spaces (no tabs)
- Line length: 100 characters max
- Imports: Group by standard library, third-party, local
- Docstrings: Use triple quotes for classes and functions
Example:
def calculate_hash(self, filepath):
"""
Calculate the hash of a file.
Args:
filepath (str): Path to the file
Returns:
str: Hex digest of the hash, or None if error
"""
try:
hasher = hashlib.md5()
with open(filepath, 'rb') as f:
while chunk := f.read(self.CHUNK_SIZE):
hasher.update(chunk)
return hasher.hexdigest()
except Exception:
return None| Type | Convention | Example |
|---|---|---|
| Classes | PascalCase | DuplicateFinder |
| Functions | snake_case | calculate_hash |
| Variables | snake_case | file_size |
| Constants | UPPER_CASE | CHUNK_SIZE |
| Private | _leading_underscore | _internal_method |
Before submitting a PR, verify:
- Application starts without errors
- Browse button opens folder dialog
- Scan completes successfully
- Duplicate files are correctly identified
- Select All / Deselect All work
- Select Duplicates works correctly
- Delete Selected moves files to Recycle Bin
- Open Location opens correct folder
- Settings save and load correctly
- File size limits work (e.g., 100MB)
- Extension filters work
- Pattern exclusions work
- Hidden/system file options work
- Long paths (>260 chars) work
- Files with special characters work
Create test data for verification:
# test_data/create_test_files.py
import os
import hashlib
# Create duplicate files
test_dir = "test_data"
os.makedirs(test_dir, exist_ok=True)
# Create original
with open(f"{test_dir}/original.txt", "w") as f:
f.write("This is test content")
# Create duplicate
with open(f"{test_dir}/duplicate.txt", "w") as f:
f.write("This is test content")
# Create different file
with open(f"{test_dir}/different.txt", "w") as f:
f.write("Different content")
print("Test files created!")Update documentation when:
- Adding new features
- Changing existing behavior
- Fixing bugs that affect user workflow
Update these files as needed:
README.md- User-facing documentationCHANGELOG.md- Version history- Code comments - For complex logic
-
Update version number in:
duplicate_file_remover.py(title and log messages)README.md(changelog)
-
Update
CHANGELOG.mdwith new features/fixes -
Create a GitHub Release with:
- Version tag (e.g.,
v1.4.0) - Release notes
- Binary attachment (if applicable)
- Version tag (e.g.,
- Open a GitHub Discussion
- Contact: @x404ctl on Instagram
Thank you for contributing! 🎉