Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-03-10 18:11:00 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-03-10 18:11:00 +0300
commitad2d90fb2475c9660b04951cd93ee969cf78c09b (patch)
treee416d05f5fc0043b1b3c04837e22b2890886e9a6 /doc/development/contributing
parent5103041796d8b3cfcfc5fdb010ebc6a3bb814df1 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/development/contributing')
-rw-r--r--doc/development/contributing/style_guides.md22
1 files changed, 21 insertions, 1 deletions
diff --git a/doc/development/contributing/style_guides.md b/doc/development/contributing/style_guides.md
index 36b38e2e16b..d24875e559a 100644
--- a/doc/development/contributing/style_guides.md
+++ b/doc/development/contributing/style_guides.md
@@ -30,7 +30,9 @@ We were using Overcommit prior to Lefthook, so you may want to uninstall it firs
### Install Lefthook
-1. Install the `lefthook` Ruby gem:
+1. You can install lefthook in [different ways](https://github.com/evilmartians/lefthook/blob/master/docs/install.md#install-lefthook).
+ If you do not choose to install it globally (e.g. via Homebrew or package managers), and only want to use it for the GitLab project,
+ you can install the Ruby gem via:
```shell
bundle install
@@ -39,12 +41,18 @@ We were using Overcommit prior to Lefthook, so you may want to uninstall it firs
1. Install Lefthook managed Git hooks:
```shell
+ # If installed globally
+ lefthook install
+ # Or if installed via ruby gem
bundle exec lefthook install
```
1. Test Lefthook is working by running the Lefthook `pre-push` Git hook:
```shell
+ # If installed globally
+ lefthook run pre-push
+ # Or if installed via ruby gem
bundle exec lefthook run pre-push
```
@@ -57,6 +65,18 @@ Lefthook is configured with a combination of:
- Project configuration in [`lefthook.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lefthook.yml).
- Any [local configuration](https://github.com/evilmartians/lefthook/blob/master/README.md#local-config).
+### Lefthook auto-fixing files
+
+We have a custom lefthook target to run all the linters with auto-fix capabilities,
+but just on the files which changed in your branch.
+
+```shell
+# If installed globally
+lefthook run auto-fix
+# Or if installed via ruby gem
+bundle exec lefthook run auto-fix
+```
+
### Disable Lefthook temporarily
To disable Lefthook temporarily, you can set the `LEFTHOOK` environment variable to `0`. For instance: