Thank you for contributing to the Phishing Awareness Training project! This guide outlines our development standards and how to submit your changes.
- Modularity: New features should be added as Flask blueprints or model methods in
app/models.py. - Consistency: Follow standard Python (snake_case) for functions/variables and PascalCase for classes.
- Simplicity: Avoid complex abstractions unless necessary; prefer readable, explicit code.
- Security: Never commit secrets or API keys. Use environment variables for configuration.
- Python: Follow PEP 8 guidelines. Use
make lintto check your code. - Flask: Use the application factory pattern and register new blueprints in
app/__init__.py. - Database: Add new DynamoDB interactions in
app/models.py. Always use the_get_tablehelper. - Templates: Extend
app/templates/base.htmland use Bootstrap 5 for all UI components.
All new features and bug fixes must be accompanied by relevant tests:
- Unit/Integration Tests: Use
pytestandmotofor mocking AWS services. - Inspector Parsing Tests: Run
pytest tests/test_inspector_parsing.pyto verify all.emlsamples are correctly viewed and placeholders cleaned. - Run Tests: Use
make test. - Validation: For changes to
.emlsamples, runmake validate-eml.
main: The production branch (protected).- Short-lived branches: Branch from
mainusingfix/<issue-number>-<slug>,feature/<milestone-slug>,docs/<slug>, orchore/<slug>. - Pull requests: Open a PR back to
mainfor every change, even for solo work, so the required checks and branch protections stay effective.
- Branch from the latest
main. - Run the required local checks:
make lint,make test,make docs-check, andterraform -chdir=phishing-platform-infra/terraform validatewhen infra changes are involved. - Link the backing issue and milestone in the PR description.
- Update the workboard and affected docs before merging.
When updating the codebase, ensure you also update the relevant documentation in the documentation/ folder:
- Architecture: Update
dev/ARCHITECTURE.mdif the system structure changes. - Operator Guides: Update
operator/files if infrastructure or deployment steps are modified. - User Guides: Update
user/files for new features visible to students or admins.