From 8f267825325a523e0384582e21c4cf8f7b114958 Mon Sep 17 00:00:00 2001 From: Harrshada Date: Mon, 10 Aug 2026 16:28:39 +0530 Subject: [PATCH 1/3] pre-commit config for Usernaut repo --- .pre-commit-config.yaml | 27 +++++++++++++++++++++++++++ CONTRIBUTING.md | 20 +++++++++++++------- 2 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..9aa66211 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,27 @@ +# Pre-commit hooks for usernaut (whole repo). +# +# Install: pip install pre-commit && pre-commit install +# Run manually: pre-commit run --all-files +# +# Do not add rh-pre-commit here: it is associate-only and Red Hat recommends +# the global install for open source repos instead of committing it to +# .pre-commit-config.yaml. See the rh-pre-commit FAQ (source.redhat.com). + +repos: + # Generic file and repo hygiene (pre-commit/pre-commit-hooks) + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + exclude: ^CODEOWNERS$ # script + CI validate; avoid pre-commit changing trailing newlines + - id: check-yaml + args: [--allow-multiple-documents] + - id: detect-private-key + - id: check-merge-conflict + + # Secret detection (requires Go >= 1.23.8; run: brew upgrade go) + - repo: https://github.com/gitleaks/gitleaks + rev: v8.28.0 + hooks: + - id: gitleaks diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ed120a85..64a88838 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,23 +10,29 @@ We welcome contributions to Usernaut! If you find a bug, have a feature request, ``` 3. **Make Changes**: Implement your changes and ensure they are well-tested. -4. **Commit Your Changes**: Commit your changes with a descriptive commit message: +4. **Install pre-commit** (recommended): + + ```bash + pip install pre-commit && pre-commit install + ``` + +5. **Commit Your Changes**: Commit your changes with a descriptive commit message: ```bash git commit -m "Add my feature" ``` -5. **Push to Your Fork**: Push your changes to your forked repository: +6. **Push to Your Fork**: Push your changes to your forked repository: ```bash git push origin feature/my-feature ``` -6. **Create a Pull Request**: Open a pull request against the `main` branch of the Usernaut repository. Provide a clear description of your changes and why they are needed. -7. **Review Process**: Your pull request will be reviewed by the Usernaut maintainers. They may request changes or provide feedback. -8. **Address Feedback**: If changes are requested, make the necessary updates in your branch and push the changes. The pull request will automatically update. -9. **Merge**: Once your pull request is approved, it will be merged into the main branch. -10. **Celebrate**: Congratulations! You've contributed to Usernaut. +7. **Create a Pull Request**: Open a pull request against the `main` branch of the Usernaut repository. Provide a clear description of your changes and why they are needed. +8. **Review Process**: Your pull request will be reviewed by the Usernaut maintainers. They may request changes or provide feedback. +9. **Address Feedback**: If changes are requested, make the necessary updates in your branch and push the changes. The pull request will automatically update. +10. **Merge**: Once your pull request is approved, it will be merged into the main branch. +11. **Celebrate**: Congratulations! You've contributed to Usernaut. ## License From c121a54ea2eb6c1f13493b8ce7b493426ab4b2c9 Mon Sep 17 00:00:00 2001 From: Harrshada Date: Mon, 10 Aug 2026 17:04:16 +0530 Subject: [PATCH 2/3] updated the instructions --- .pre-commit-config.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9aa66211..26dccbad 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,10 +2,6 @@ # # Install: pip install pre-commit && pre-commit install # Run manually: pre-commit run --all-files -# -# Do not add rh-pre-commit here: it is associate-only and Red Hat recommends -# the global install for open source repos instead of committing it to -# .pre-commit-config.yaml. See the rh-pre-commit FAQ (source.redhat.com). repos: # Generic file and repo hygiene (pre-commit/pre-commit-hooks) From 5bcdcdd8404f380a1b2c2c74918cea00e04012b1 Mon Sep 17 00:00:00 2001 From: Harrshada Date: Mon, 10 Aug 2026 17:09:33 +0530 Subject: [PATCH 3/3] excluded vendor file --- .pre-commit-config.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 26dccbad..da3877ca 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,6 +3,8 @@ # Install: pip install pre-commit && pre-commit install # Run manually: pre-commit run --all-files +exclude: ^vendor/ + repos: # Generic file and repo hygiene (pre-commit/pre-commit-hooks) - repo: https://github.com/pre-commit/pre-commit-hooks