Sha256: aa631500a707d290f3d8f11f08eb4f249e5e52103cf4ca15b2ebe11e8685fca0

Contents?: true

Size: 1.02 KB

Versions: 58

Compression:

Stored size: 1.02 KB

Contents

# Style Guide

## RuboCop rule development guide

Our codebase style is defined and enforced by [RuboCop](https://github.com/rubocop/rubocop).

You can check for any offenses locally with `bundle exec rubocop --parallel`.
On the CI, this is automatically checked by the `rubocop` jobs in the `check` stage.

### Lefthook

[Lefthook](https://github.com/evilmartians/lefthook) is a Git hooks manager that allows
custom logic to be executed prior to Git committing or pushing. GitLab comes with
Lefthook configuration (`lefthook.yml`), but it must be installed.

We have a `lefthook.yml` checked in but it is ignored until Lefthook is installed.

### Install Lefthook

   ```shell
   # Install the `lefthook` Ruby gem:
   bundle install
   # Initialize the lefthook config and adds to .git/hooks dir
   bundle exec lefthook install
   # Verify hook execution works as expected
   bundle exec lefthook run pre-push
   ```

For a detailed guide on left hook configuration see https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
gitlab-qa-14.0.1 docs/developer/style_guide.md
gitlab-qa-14.0.0 docs/developer/style_guide.md
gitlab-qa-13.2.1 docs/developer/style_guide.md
gitlab-qa-13.2.0 docs/developer/style_guide.md
gitlab-qa-13.1.0 docs/developer/style_guide.md
gitlab-qa-13.0.0 docs/developer/style_guide.md
gitlab-qa-12.5.1 docs/developer/style_guide.md
gitlab-qa-12.5.0 docs/developer/style_guide.md
gitlab-qa-12.4.1 docs/developer/style_guide.md
gitlab-qa-12.4.0 docs/developer/style_guide.md
gitlab-qa-12.3.0 docs/developer/style_guide.md
gitlab-qa-10.3.0.1 docs/developer/style_guide.md
gitlab-qa-12.2.1 docs/developer/style_guide.md
gitlab-qa-12.2.0 docs/developer/style_guide.md
gitlab-qa-12.1.0 docs/developer/style_guide.md
gitlab-qa-12.0.0 docs/developer/style_guide.md
gitlab-qa-11.3.0 docs/developer/style_guide.md
gitlab-qa-11.2.0 docs/developer/style_guide.md
gitlab-qa-11.1.0 docs/developer/style_guide.md
gitlab-qa-11.0.0 docs/developer/style_guide.md