Thank you for considering contributing to SCANRUNNER-CLI! We welcome contributions from everyone, whether you're fixing a bug, proposing new features, improving documentation, or suggesting ideas. This guide will help you get started.
- How to Contribute
- Code of Conduct
- Getting Started
- Reporting Issues
- Submitting Pull Requests
- Coding Guidelines
- Development Workflow
- Fork the repository to your GitHub account.
- Clone your fork to your local machine.
- Create a new branch for your changes.
- Commit your changes and push them to your fork.
- Submit a pull request (PR) to the main repository.
We expect contributors to adhere to our Code of Conduct. Be respectful and considerate in all interactions.
- Go version 1.20 or later installed.
- Familiarity with Git, GitHub, and command-line tools.
- Recommended tools:
make
(for automation),docker
(for testing environments).
-
Clone the repository:
git clone https://github.com/your-username/scanrunner-cli.git cd scanrunner-cli
-
Install dependencies:
go mod download
-
Build the project:
go build -o scanrunner main.go
-
Run tests to ensure everything works:
go test ./...
If you find a bug or have a feature request, please file an issue in the GitHub repository.
- Check if the issue already exists in the issues list.
- If not, open a new issue and provide:
- A clear title.
- Steps to reproduce (if applicable).
- Expected and actual behavior.
- Any relevant logs, screenshots, or code snippets.
-
Fork and Clone:
- Fork the repository to your GitHub account.
- Clone your fork locally:
git clone https://github.com/your-username/scanrunner-cli.git
-
Create a Branch:
- Use descriptive branch names like
fix-bug-xyz
oradd-new-feature
.git checkout -b branch-name
- Use descriptive branch names like
-
Make Changes:
- Follow the coding guidelines outlined below.
-
Commit Changes:
- Write clear commit messages:
git commit -m "Fix: Correct YAML parsing error in scan command"
- Write clear commit messages:
-
Push to Your Fork:
git push origin branch-name
-
Submit a Pull Request:
- Open a PR against the
main
branch. - Include a description of the changes, a reference to the issue (if applicable), and testing steps.
- Open a PR against the
-
Code Style:
- Follow the Go standard coding style (use
gofmt
). - Write clean, self-documenting code with clear variable and function names.
- Follow the Go standard coding style (use
-
Testing:
- Write tests for any new functionality or bug fixes.
- Place tests in the appropriate
test/
subdirectory (e.g.,test/fileparser_test.go
).
-
Documentation:
- Update relevant documentation (e.g.,
README.md
,docs/
) for any new features or changes. - Ensure CLI commands include clear descriptions and usage examples.
- Update relevant documentation (e.g.,
-
Commit Messages:
-
Use descriptive messages:
Type: Short description (50 chars max) Optional detailed explanation (if needed, wrapped at 72 chars).
Examples:
Feat: Add AI-based suggestion generator
Fix: Resolve JSON parsing error in validate command
-
Run the built CLI tool locally:
./scanrunner scan --path ./example-files
Run all tests:
go test ./...
Run specific tests:
go test ./internal/compliance -v
Build the CLI binary:
go build -o scanrunner main.go
A Makefile
is included for automation:
make build # Build the CLI
make test # Run all tests
make lint # Run linters
- Open an issue for questions or concerns.
- Check out the discussions for ongoing conversations.
Thank you for contributing to SCANRUNNER-CLI! 🚀