You can test your changes to the documentation by building and running a docker container.
Prerequisites: Docker installed and running locally.
Build the container image:
make-f./builder/Makefile.mkdocsmkdocs-build
Serve the container image:
make-f./builder/Makefile.mkdocsmkdocs-serve
Open localhost:8000/tracee
Now you should see the documentation.
Check that everything is like you intent.
We welcome contributions to Tracee's codebase! Before submitting your changes, please familiarize yourself with these guidelines.
To contribute to the code:
Tracee relies on several generated files and has strict formatting requirements. Ensure you run the following commands before committing:
NOTE: In order to not depend on host's libraries versions, we recommend that you always run make and other project dependencies on a virtual environment so the formatting will be align with Tracee guidelines
Man Pages Generation: If you've modified core code or documentation that impacts the man pages, run:
make-fbuilder/Makefile.man
This regenerates the man pages to reflect your changes.
Protocol Buffer Compilation: If your changes involve modifications to protocol buffer (.proto) files,run:
make-fbuilder/Makefile.man
This regenerates the corresponding Go code.
Pre-commit checks: Every time you're about to create a pull request, execute:
NOTE: If your host machine dependencies doesn't align with Tracee dependencies, This command have to run on a supported environment
makecheck-pr
This command performs essential checks:
- check-fmt: Verifies code formatting adheres to project standards.
- check-lint: Runs linting tools (e.g., golangci-lint) to catch potential issues.
- check-code: Performs static code analysis for both Go and C code.
- format-pr: Displays the commits in your PR in a standardized format.
Note:check-fmt,check-lint,check-code,format-pr are individual make command combined under check-pr. You can run the following command without any vm using Makefile
For check-fmt:
make-fbuilder/Makefile.checkersfmt-check
For check-code:
make-fbuilder/Makefile.checkerscode-check
Fixing Code Formatting: If check-fmt reports issues, use:
make-fbuilder/Makefile.checkersfmt-fix
This automatically formats your Go and C code to meet project standards. Review the changes with git status -s before committing.