This repository contains pre-commit hooks for Golang projects.
To use these pre-commit hooks in your Golang project, follow these steps:
-
Install the
pre-commit
tool by runningpip install pre-commit
in your terminal. -
Create a
.pre-commit-config.yaml
file in the root of your project with the following contents:repos: - repo: https://bitbucket.org/<YOUR_USERNAME>/<YOUR_REPOSITORY_NAME> rev: <COMMIT_HASH> # Replace with the commit hash of the latest version of this repository hooks: - id: go-sec - id: dependency-check
-
Run
pre-commit install
in your terminal to install the pre-commit hooks in your local repository. -
Commit the
.pre-commit-config.yaml
file to your repository. -
Now, every time you run
git commit
, the pre-commit hooks will automatically run and check your code for security vulnerabilities and outdated dependencies.
To contribute to this repository, follow these steps:
- Fork this repository on Bitbucket.
- Clone your forked repository to your local machine.
- Create a new branch for your changes:
git checkout -b my-new-branch
. - Make your changes and commit them:
git commit -am 'Add some feature'
. - Push your changes to your forked repository:
git push origin my-new-branch
. - Create a pull request from your forked repository to this repository.
- Wait for the maintainers to review and merge your pull request.