Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5157b2ee
Commit
5157b2ee
authored
Nov 04, 2020
by
Evan Read
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update docs guide for lefthook
parent
425982b7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
12 deletions
+9
-12
doc/development/contributing/style_guides.md
doc/development/contributing/style_guides.md
+5
-7
doc/development/documentation/index.md
doc/development/documentation/index.md
+4
-5
No files found.
doc/development/contributing/style_guides.md
View file @
5157b2ee
...
...
@@ -17,9 +17,8 @@ we suggest investigating to see if a plugin exists. For instance here is the
## Pre-push static analysis
We strongly recommend installing
[
Lefthook
](
https://github.com/Arkweid/lefthook
)
to automatically check for
static analysis offenses before pushing your changes.
We strongly recommend installing
[
Lefthook
](
https://github.com/Arkweid/lefthook
)
to automatically check
for static analysis offenses before pushing your changes.
To install
`lefthook`
, run the following in your GitLab source directory:
...
...
@@ -33,10 +32,9 @@ overcommit --uninstall
gem
install
lefthook
&&
lefthook
install
-f
```
Before you push your changes, Lefthook will then automatically run Danger checks, as well
as RuboCop, ES Lint, HAML Lint, and SCSS Lint for the changed files.
This saves you time as you don't have to wait for the same errors to be detected by CI/CD.
Before you push your changes, Lefthook then automatically run Danger checks, and other checks
for changed files. This saves you time as you don't have to wait for the same errors to be detected
by CI/CD.
Lefthook relies on a pre-push hook to prevent commits that violate its ruleset.
If you wish to override this behavior, pass the environment variable
`LEFTHOOK=0`
.
...
...
doc/development/documentation/index.md
View file @
5157b2ee
...
...
@@ -708,15 +708,14 @@ Git [pre-commit hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks)
run tests or other processes before committing to a branch, with the ability to not commit to the branch if
failures occur with these tests.
[`
overcommit`](https://github.com/sds/overcommit
) is a Git hooks manager, making configuring,
[`
lefthook`](https://github.com/Arkweid/lefthook
) is a Git hooks manager, making configuring,
installing, and removing Git hooks easy.
Sample configuration for `overcommit` is available in the
[`.overcommit.yml.example`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.overcommit.yml.example)
Configuration for `left` is available in the [`lefthook.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lefthook.yml)
file for the [`gitlab`](https://gitlab.com/gitlab-org/gitlab) project.
To set up `
overcommit
` for documentation linting, see
[Pre-
commit
static analysis](../contributing/style_guides.md#pre-push-static-analysis).
To set up `
lefthook
` for documentation linting, see
[Pre-
push
static analysis](../contributing/style_guides.md#pre-push-static-analysis).
#### Disable Vale tests
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment