Thank you for your interest in contributing to PenWeb! We welcome contributions from the community and are grateful for your support.
- Code of Conduct
- How to Contribute
- Development Setup
- Coding Standards
- Testing Requirements
- Commit Message Guidelines
- Pull Request Process
- Reporting Issues
By participating in this project, you agree to abide by our Code of Conduct. Please read it to understand what actions will and will not be tolerated.
We welcome several types of contributions:
- Bug Reports: Help us identify and fix issues
- Feature Requests: Suggest new features or improvements
- Code Contributions: Submit bug fixes or new features
- Documentation: Improve or expand our documentation
- Testing: Add or improve test coverage
- Fork the Repository: Click the 'Fork' button at the top right of the repository page
- Clone Your Fork:
git clone https://github.com/YOUR_USERNAME/websec.git cd websec - Add Upstream Remote:
git remote add upstream https://github.com/alexcolls/websec.git
- Create a Feature Branch:
git checkout -b feature/your-feature-name
- Python 3.9 or higher
- Poetry for dependency management
- Git
-
Initialize Git Submodules (required for GPS, VPN, Email CLI tools):
git submodule update --init --recursive
-
Install Poetry (if not already installed):
curl -sSL https://install.python-poetry.org | python3 - -
Install Dependencies:
poetry install
-
Set Up Environment Variables:
cp .env.sample .env # Edit .env with your configuration (optional - tools work with defaults) -
Run the Application:
./run.sh # or poetry run python src/main.py
We maintain high code quality standards to ensure the project remains maintainable and consistent.
- Python Version: Python 3.9+
- Formatter: Black with 100 character line length
- Linter: Flake8
- Type Checker: Mypy with type hints where appropriate
Before submitting a pull request, ensure your code passes all quality checks:
# Format code with Black
poetry run black src/ test/
# Run Flake8 linting
poetry run flake8 src/ test/
# Run Mypy type checking
poetry run mypy src/
# Run all tests
poetry run pytest test/ -v
# Run tests with coverage
poetry run pytest test/ --cov=src --cov-report=html- Follow PEP 8: Adhere to Python's style guide
- Use Type Hints: Add type hints to function signatures
- Write Docstrings: All functions and classes should have docstrings
- Keep Functions Small: Each function should do one thing well
- Avoid Magic Numbers: Use named constants instead
- Handle Errors Gracefully: Use try-except blocks and provide meaningful error messages
"""Module for handling URL operations."""
from typing import Dict, Any
def ping_url(url: str, timeout: int = 10) -> Dict[str, Any]:
"""
Ping a URL and return response information.
Args:
url: The URL to ping
timeout: Request timeout in seconds (default: 10)
Returns:
Dictionary containing status_code and response_time_ms
Raises:
ValueError: If URL is invalid
requests.RequestException: If request fails
"""
# Implementation here
passAll code contributions must include appropriate tests.
test/
├── __init__.py
├── unit/
│ ├── __init__.py
│ ├── test_ping.py
│ ├── test_clone.py
│ ├── test_d2.py
│ └── test_attempt_login.py
└── e2e.py
- Unit Tests: Test individual functions and classes
- Integration Tests: Test component interactions
- End-to-End Tests: Test complete workflows
- Use descriptive test function names:
test_ping_url_returns_status_code() - Test both success and failure cases
- Mock external dependencies (network requests, file I/O, etc.)
- Aim for at least 80% code coverage
- Use pytest fixtures for common setup code
# Run all tests
poetry run pytest
# Run specific test file
poetry run pytest test/unit/test_ping.py
# Run with verbose output
poetry run pytest -v
# Run with coverage report
poetry run pytest --cov=src --cov-report=htmlWe follow a convention of using emojis in commit messages to make the git history more readable and expressive.
<emoji> <type>: <subject>
<body (optional)>
<footer (optional)>
| Emoji | Type | Usage |
|---|---|---|
| ✨ | feat | New feature or functionality |
| 🐛 | fix | Bug fix |
| 📝 | docs | Documentation changes |
| 🎨 | style | Code style/formatting changes |
| ♻️ | refactor | Code refactoring |
| ⚡ | perf | Performance improvements |
| ✅ | test | Adding or updating tests |
| 🔧 | chore | Build process or auxiliary tool changes |
| 🔒 | security | Security fixes or improvements |
| 🏷️ | release | Version tags or releases |
| 🚀 | deploy | Deployment changes |
| 📦 | build | Build system or dependencies |
| 🔥 | remove | Removing code or files |
| 🚧 | wip | Work in progress |
✨ feat: add GPS tracking feature to CLI menu
🐛 fix: resolve import error in lambda entrypoint
📝 docs: update README with installation instructions
✅ test: add unit tests for ping utility
🔧 chore: update dependencies to latest versions- Use Present Tense: "add feature" not "added feature"
- Be Descriptive: Explain what and why, not how
- Keep Subject Line Short: Under 72 characters
- Add Body for Complex Changes: Explain the reasoning
- Reference Issues: Include issue numbers when applicable
- ✅ Ensure all tests pass
- ✅ Run code quality checks (Black, Flake8, Mypy)
- ✅ Update documentation if needed
- ✅ Add tests for new features
- ✅ Update CHANGELOG.md with your changes
- ✅ Rebase on latest main branch
-
Push Your Branch:
git push origin feature/your-feature-name
-
Create Pull Request: Go to GitHub and create a PR from your branch to
main -
Fill Out PR Template: Provide a clear description of your changes
-
Link Related Issues: Use "Fixes #123" or "Closes #456" to link issues
-
Request Review: Tag maintainers for review
<emoji> <type>: <description>
Example: ✨ feat: add VPN connection status indicator
## Description
Brief description of what this PR does
## Type of Change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
## Testing
- [ ] All existing tests pass
- [ ] New tests added for new functionality
- [ ] Manual testing performed
## Checklist
- [ ] Code follows project style guidelines
- [ ] Self-review completed
- [ ] Comments added for complex code
- [ ] Documentation updated
- [ ] No new warnings generated
- [ ] CHANGELOG.md updated
## Related Issues
Fixes #(issue number)
## Screenshots (if applicable)- At least one maintainer must approve the PR
- All CI checks must pass
- Resolve all review comments
- Maintainers will merge your PR once approved
When reporting bugs, please include:
- Clear Title: Summarize the bug in the title
- Description: Detailed description of the issue
- Steps to Reproduce: List steps to reproduce the behavior
- Expected Behavior: What you expected to happen
- Actual Behavior: What actually happened
- Environment:
- OS: (e.g., Ubuntu 22.04, macOS 13)
- Python version: (e.g., 3.9.7)
- Poetry version: (e.g., 1.6.1)
- PenWeb version: (e.g., 0.3.1)
- Logs/Screenshots: Include relevant logs or screenshots
- Additional Context: Any other relevant information
When requesting features, please include:
- Clear Title: Summarize the feature in the title
- Problem Statement: Describe the problem this feature would solve
- Proposed Solution: Describe your proposed solution
- Alternatives: Describe alternatives you've considered
- Additional Context: Any other relevant information
DO NOT report security vulnerabilities through public GitHub issues. Please follow our Security Policy instead.
By contributing to PenWeb, you agree that your contributions will be licensed under the MIT License.
Feel free to reach out to the maintainers if you have any questions:
- Open a Discussion
- Contact: alex@alexcolls.com
Thank you for contributing to PenWeb! 🎉