Skip to content

Commit

Permalink
feat(build): fluidattacks#1108 document contributing
Browse files Browse the repository at this point in the history
Add new sections to the contributing.md file to help newcomers.

- Running your local changes
- Adding yourself to the mailmap
- Validating commit message
- DCO
- Adding and rendering documentation

Update lintMarkdown config.

Signed-off-by: Robin Quintero <rohaquinlop301@gmail.com>
  • Loading branch information
rohaquinlop committed Jun 17, 2023
1 parent 97ccd84 commit 5944d9d
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 10 deletions.
62 changes: 53 additions & 9 deletions docs/src/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,50 @@ We can discuss implementation details [here][makes_issues].
1. [Git][git]-push changes to your fork
1. Create a **Pull Request** from your fork to [Makes][makes]

Guidelines:
### Testing your local changes

- Keep it simple
- Remember we write code for humans, not machines
- Write an argument: `/src/args`
- Write a module (if applies): `/src/evaluator/modules`
- Write docs: `/README.md` or `/docs`
- Write a test: `/makes.nix` or `/makes/**/main.nix`
- Write a test [GitHub workflow][github_workflows]: `/.github/workflows/dev.yml`
You can run local changes by simply running `m . <job>`.
If you're adding new files, make sure to `git add` them first.

Examples:
### Adding documentation

- All changes must be documented in the same PR.
- You can run `m . /docs/dev` to serve the [docs site](https://makes.fluidattacks.com)
on localhost.
- Make sure you lint the documentation with `m . /lintMarkdown/all`

### Adding tests

- All new [builtins](https://makes.fluidattacks.com/api/builtins/) must be
tested.
- You can add tests to either `/makes.nix` or `/makes/your-builtin/main.nix`
depending on the nature of the builtin.
- Make sure to add such tests to the [GitHub Actions pipelines as well](https://github.com/fluidattacks/makes/tree/main/.github/workflows).

### Adding yourself to the mailmap

You must add yourself to the
[.mailmap](https://github.com/fluidattacks/makes/blob/main/.mailmap) file.
Make sure to test it with `m . /lintGitMailMap`.

### Validating commit message

- Your commit message must follow this [syntax](https://github.com/fluidattacks/makes/tree/main/test/lint-commit-msg).
- You must sign your commits by adding a `Signed-off-by` line at the end of your
commit message.
- You can take a look at other commits [here](https://github.com/fluidattacks/makes/commits/main).
- Make sure to test it with `m . /lintGitCommitMsg`.

### Other PR rules

A PR must:

- Only be one commit ahead of main.
- Have a title and body equal to its commmit message.

### Examples

Code contributions:

- [feat(build): #262 lint git mailmap](https://github.com/fluidattacks/makes/commit/01fcd5790dd54b117da63bcc2480437135da8bb3)
- [feat(build): #232 lint terraform](https://github.com/fluidattacks/makes/commit/081835b563c712b7650dbc5bf1e306d4aff159cf)
Expand All @@ -38,6 +71,17 @@ Examples:
- [feat(build): #252 aws secrets from env](https://github.com/fluidattacks/makes/commit/1c9f06a809bd92d56939d5809ce46058856fdf0a)
- [feat(build): #232 make parallel utils](https://github.com/fluidattacks/makes/commit/99e9f77482a6cbc9858a7a928a91a8a8aa9ff353)

Validating commit message:

```
feat(build): #1099 licensing builtin with reuse
- Create `testLicense` builtin with reuse.
- Add job to dev pipeline
Signed-off-by: Robin Quintero <rohaquinlop301@gmail.com>
```

### The legal side of contributions

All of the code
Expand Down
2 changes: 1 addition & 1 deletion test/lint-markdown/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
rule 'MD010'
rule 'MD011'
rule 'MD012'
rule 'MD013', :tables => false, :code_blocks => false
rule 'MD013', :tables => false, :ignore_code_blocks => true
rule 'MD018'
rule 'MD019'
rule 'MD020'
Expand Down

0 comments on commit 5944d9d

Please sign in to comment.