|
| 1 | +# Contributing to LaraC2 Shell |
| 2 | + |
| 3 | +Thank you for your interest in contributing. This document provides guidelines for contributing to LaraC2 Shell. |
| 4 | + |
| 5 | +## Getting Started |
| 6 | + |
| 7 | +1. **Fork** the repository |
| 8 | +2. **Clone** your fork locally |
| 9 | +3. **Create a branch** for your changes: `git checkout -b feature/my-feature` |
| 10 | +4. **Make your changes** and add tests |
| 11 | +5. **Run tests** to verify nothing is broken |
| 12 | +6. **Commit** with a clear message |
| 13 | +7. **Push** and open a Pull Request |
| 14 | + |
| 15 | +## Development Setup |
| 16 | + |
| 17 | +```powershell |
| 18 | +# Prerequisites: PowerShell Core 7.0+, Pester 5.x, PSScriptAnalyzer |
| 19 | +Install-Module -Name Pester -MinimumVersion 5.0 -Scope CurrentUser |
| 20 | +Install-Module -Name PSScriptAnalyzer -Scope CurrentUser |
| 21 | +
|
| 22 | +# Run offline tests (no MDE tenant needed) |
| 23 | +pwsh -NoProfile -Command "Invoke-Pester -Path tests/shell/LaraC2Shell.Offline.Tests.ps1 -Output Detailed" |
| 24 | +
|
| 25 | +# Run the same lint CI runs |
| 26 | +pwsh -NoProfile -Command "Invoke-ScriptAnalyzer -Path ./shell -Recurse -Settings ./.config/PSScriptAnalyzerSettings.psd1" |
| 27 | +``` |
| 28 | + |
| 29 | +## Code Style |
| 30 | + |
| 31 | +- Follow existing patterns in the codebase |
| 32 | +- Use `[CmdletBinding()]` and proper parameter validation |
| 33 | +- Include `.SYNOPSIS` and `.PARAMETER` documentation for public functions |
| 34 | +- Private helper functions use `_` prefix (e.g., `_Out-Info`, `_Parse-Response`) |
| 35 | +- PSScriptAnalyzer runs on every PR -- check `.config/PSScriptAnalyzerSettings.psd1` for rules |
| 36 | + |
| 37 | +## Testing |
| 38 | + |
| 39 | +- **All PRs must pass offline tests** (712+ tests, no credentials needed) and the PSScriptAnalyzer lint job |
| 40 | +- Add tests for new features or bug fixes |
| 41 | +- Test files go in `tests/shell/` following the existing naming convention |
| 42 | +- Online tests require an MDE tenant and are run separately |
| 43 | + |
| 44 | +## Pull Request Process |
| 45 | + |
| 46 | +1. Ensure all offline tests pass |
| 47 | +2. Update documentation if your change affects user-facing behavior |
| 48 | +3. Keep PRs focused -- one feature or fix per PR |
| 49 | +4. Describe what your PR does and why in the description |
| 50 | + |
| 51 | +## Reporting Issues |
| 52 | + |
| 53 | +- Use GitHub Issues with the provided templates |
| 54 | +- Include: PowerShell version, OS, error messages, steps to reproduce |
| 55 | +- For security vulnerabilities, follow [SECURITY.md](../SECURITY.md) -- do not open a public issue |
| 56 | + |
| 57 | +## License |
| 58 | + |
| 59 | +By contributing, you agree that your contributions will be licensed under the MIT License. |
0 commit comments