First off, thank you for considering contributing to Universal Code Validator! 🎉
Before creating bug reports, please check existing issues to avoid duplicates.
When creating a bug report, include:
- Clear title and description
- Steps to reproduce
- Expected vs actual behavior
- Python version
- Platform (Desktop/Android/Pydroid 3/Termux)
- Sample code (if applicable)
- Output/error messages
Example:
**Bug:** False positive on string containing 'eval'
**Steps:**
1. Create file with string: `message = "Please evaluate your options"`
2. Run validator
3. See security warning
**Expected:** No warning (it's just a string)
**Actual:** Security warning about eval usage
**Python:** 3.9.5
**Platform:** Pydroid 3 on Android 12
Enhancement suggestions are tracked as GitHub issues. When creating one:
- Use clear, descriptive title
- Explain the problem this enhancement would solve
- Describe the solution you'd like
- Describe alternatives you've considered
- Provide examples if applicable
- Fork the repo and create your branch from
main - Make your changes following our coding standards
- Test your changes on various Python files
- Test on Android if changes affect mobile users
- Update documentation if needed
- Write clear commit messages
- Submit the pull request
# Clone your fork
git clone https://github.com/YOUR_USERNAME/universal-code-validator.git
cd universal-code-validator
# Create a branch
git checkout -b feature/your-feature-name- Follow PEP 8
- Use type hints where appropriate
- Write docstrings for functions and classes
- Keep functions focused and single-purpose
def analyze_complexity(node: ast.Node) -> float:
"""
Calculate cyclomatic complexity of an AST node.
Args:
node: AST node to analyze
Returns:
Complexity score as float
"""
# Implementation
pass- Group related functions together
- Use clear, descriptive names
- Add comments for complex logic
- Keep files under 2000 lines when possible
Test your changes on:
- Simple scripts
- Complex frameworks
- Various Python versions (3.7+)
- Edge cases
- Android devices (if applicable)
Example test:
# Test on a simple script
python UNIVERSAL_CODE_VALIDATOR_V3.py examples/simple_script.py
# Test on a complex project
python UNIVERSAL_CODE_VALIDATOR_V3.py examples/django_project/
# Test interactive mode
python UNIVERSAL_CODE_VALIDATOR_V3.py
# Press Enter to test default behaviorUse clear, descriptive commit messages:
✅ Good:
- "Add support for detecting asyncio anti-patterns"
- "Fix false positive on type hints with 'eval' string"
- "Improve maintainability index calculation"
- "Update Android setup documentation"
❌ Bad:
- "Update code"
- "Fix bug"
- "Changes"
[Type] Brief description
Detailed explanation of what and why (if needed)
Examples:
- [Feature] Add asyncio anti-pattern detection
- [Fix] Resolve false positive on type hints with 'eval'
- [Docs] Update Android setup guide
- [Refactor] Simplify complexity calculation logic
- [Test] Add test cases for role detection
We use these labels:
bug- Something isn't workingenhancement- New feature requestdocumentation- Documentation improvementsgood first issue- Good for newcomershelp wanted- Extra attention neededandroid- Android-specific issuessecurity- Security-relatedperformance- Performance improvements
If your changes affect mobile users, test on:
- Pydroid 3
- Termux
- Different Android versions
Report results in your PR:
Tested on:
- Pydroid 3 (Android 12) ✅
- Termux (Android 11) ✅
- Desktop Python 3.9 ✅
- Desktop Python 3.11 ✅
When adding new validation checks:
- Add to appropriate analyzer class
- Define clear severity levels
- Include helpful suggestions
- Test for false positives
- Update documentation
- Consider role-aware weighting
Example:
def check_new_pattern(self, node: ast.Node) -> None:
"""
Check for [pattern name] anti-pattern.
This detects when...
"""
if self._is_bad_pattern(node):
issue = Issue(
type=IssueType.ANTI_PATTERN,
severity=Severity.HIGH,
message="Clear description of the problem",
suggestion="How to fix it",
file_path=self.file_path,
line_number=node.lineno,
)
self.issues.append(issue)If proposing a new code role:
- Justify the need - Why is this role distinct?
- Define clear characteristics - What makes code this role?
- Set appropriate thresholds - Complexity ranges, etc.
- Update role weights - How should rules be weighted?
- Provide examples - Real code that fits this role
- Test extensively - Ensure accurate detection
Update documentation when you:
- Add new features
- Change behavior
- Add new checks
- Fix bugs that users might encounter
- Modify Android compatibility
Files to update:
README.md- Main documentationQUICK_START.md- If it affects getting startedANDROID_SETUP.md- If it affects Android users- Code docstrings - Always!
- Changelog section in README
- Automated checks run on your PR (if set up)
- Maintainer review (usually within 48 hours)
- Address feedback if needed
- Testing on multiple platforms
- Approval and merge
- Be respectful and inclusive
- Welcome newcomers
- Accept constructive criticism
- Focus on what's best for the community
- Show empathy towards other contributors
- Harassment or discrimination
- Trolling or insulting comments
- Personal or political attacks
- Publishing others' private information
- Other unprofessional conduct
Current priorities:
- 🐛 Bug fixes for false positives
- 📱 Android-specific improvements
- 📚 Documentation improvements
- ✨ New pattern detections
- 🧪 Test case additions
- 🌍 Performance optimizations
Contributors will be:
- Listed in
CONTRIBUTORS.md - Mentioned in release notes
- Credited in documentation (for significant contributions)
Good first contributions:
- Fix typos in documentation
- Add examples to README
- Improve error messages
- Add test cases
- Report bugs with detailed reproduction steps
- Suggest Android-specific features
- 💬 Open a Discussion
- 📧 Email: inbox.globaltrade@gmail.com
- 🐛 Check existing Issues
Every contribution matters:
- Reporting bugs 🐛
- Suggesting features 💡
- Improving docs 📚
- Writing code 💻
- Helping others 🤝
- Testing on different platforms 🧪
Thank you for making Universal Code Validator better!
Happy Contributing! 🚀