Thank you for your interest in contributing to Devkit! This guide explains how to contribute effectively.
git clone https://github.com/YOUR_USERNAME/devkit.git
cd devkitgit checkout -b feature/your-feature-name# Install dependencies
./bootstrap.sh --python-only
# Install pre-commit hooks
pre-commit install
# Run tests
python3 -m unittest discover tests -v- Use
shellcheckfor linting - Follow Google Shell Style Guide
- Use
set -euo pipefailfor error handling - Quote all variables:
"$VAR"not$VAR - Add comments for complex logic
- Use Python 3.9+
- Follow PEP 8 style guide
- Add type hints to all functions
- Include docstrings
- Use meaningful variable names
- Use
ansible-lintfor validation - Write descriptive task names
- Add proper error handling
- Tag all tasks appropriately
- Use variables instead of hardcoding
- Use 2-space indentation
- Keep line length under 100 characters
- Add comments for non-obvious configuration
# All tests
python3 -m unittest discover tests -v
# Specific test file
python3 -m unittest tests.test_config_security -v
# Specific test
python3 -m unittest tests.test_config_security.TestConfigSecurityPermissions.test_secure_config_created_with_0600 -v# Config security tests
python3 -m unittest tests.test_config_security -v
# Plugin security tests
python3 -m unittest tests.test_plugin_security -v# Run all checks
pre-commit run --all-files
# Run specific hook
pre-commit run shellcheck --all-filesFollow this format (from CLAUDE.md):
<type>: <brief description (50 chars max)>
Fixes #<issue-number>
Types:
feat:- New featurefix:- Bug fixdocs:- Documentationrefactor:- Code refactoringtest:- Testschore:- Maintenancesecurity:- Security fixes
Examples:
feat: add health check scriptfix: resolve config permission issuedocs: update CONTRIBUTING guidesecurity: add checksum verification
-
Create PR with descriptive title
- Use imperative mood: "Add feature" not "Added feature"
- Reference issues: Fixes #123
-
Fill PR template
- Describe changes
- Add testing steps
- Link related issues
-
Ensure CI passes
- All tests must pass
- shellcheck must pass
- ansible-lint must pass
- No new security issues
-
Request review
- Tag relevant reviewers
- Address feedback promptly
-
Merge
- Squash small commits if needed
- Use descriptive merge message
DO NOT create public issues for security vulnerabilities.
Instead:
- Email security details to the maintainer
- Include affected versions
- Describe impact
- Provide proof-of-concept if possible
See SECURITY.md for detailed policy.
- Update README.md for user-facing changes
- Update relevant docs in /docs directory
- Keep CHANGELOG.md updated
- Add docstrings to Python code
- Comment complex bash logic
- Minimize shell invocations in loops
- Use built-in bash features when possible
- Profile slow operations
- Document performance characteristics
We follow Semantic Versioning:
- MAJOR: Breaking changes
- MINOR: New features (backward-compatible)
- PATCH: Bug fixes
- Check existing issues
- Review documentation
- See SECURITY.md for security info
- Check SUPPORT.md for support options
Be respectful, inclusive, and professional. See CODE_OF_CONDUCT.md.
By contributing, you agree your code is licensed under Apache 2.0.
Happy contributing! 🎉