Skip to content

Commit

Permalink
improve guidelines to use makefiles mostly
Browse files Browse the repository at this point in the history
  • Loading branch information
ShohamBit committed Dec 17, 2024
1 parent ab51f00 commit 540c8ce
Showing 1 changed file with 15 additions and 21 deletions.
36 changes: 15 additions & 21 deletions docs/contributing/guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ 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

1. Man Pages Generation: If you've modified core code or documentation that impacts the man pages, run:

```bash
Expand All @@ -64,6 +66,8 @@ Tracee relies on several generated files and has strict formatting requirements.

3. 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](./building/environment.md)

```bash
make check-pr
```
Expand All @@ -74,37 +78,27 @@ Tracee relies on several generated files and has strict formatting requirements.
- `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`
4. Fixing Code Formatting: If `check-fmt` reports issues, use:
```bash
make fix-fmt
```
This automatically formats your Go and C code to meet project standards. Review the changes with `git status -s` before committing.
**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

If you don't want to depend on host's libraries versions, or your host is not an **Alpine Linux**/**Ubuntu Linux** or you are using the `alpine-make`/`ubuntu-make` container as a replacement for `make`:
- For `check-fmt`:

you can run the equivalents checks in a container:
```bash
make -f builder/Makefile.checkers fmt-check
```

- For `check-fmt`:
- For `check-code`:

```bash
make -f builder/Makefile.checkers fmt-check
```
```bash
make -f builder/Makefile.checkers code-check
```

- For `fix-fmt`:
4. Fixing Code Formatting: If `check-fmt` reports issues, use:

```bash
make -f builder/Makefile.checkers fmt-fix
```

- For `check-code`:
```bash
make -f builder/Makefile.checkers code-check
```
This automatically formats your Go and C code to meet project standards. Review the changes with `git status -s` before committing.

### Performance Considerations

Expand Down

0 comments on commit 540c8ce

Please sign in to comment.