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
0144afa7
Commit
0144afa7
authored
Aug 05, 2020
by
Evan Read
Committed by
Marcel Amirault
Aug 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add documentation for using overcommit
Also add example configuration for documentation linters.
parent
bcbb31f6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
11 deletions
+45
-11
.overcommit.yml.example
.overcommit.yml.example
+16
-0
doc/.vale/gitlab/spelling-exceptions.txt
doc/.vale/gitlab/spelling-exceptions.txt
+1
-0
doc/development/contributing/style_guides.md
doc/development/contributing/style_guides.md
+8
-11
doc/development/documentation/index.md
doc/development/documentation/index.md
+20
-0
No files found.
.overcommit.yml.example
View file @
0144afa7
...
...
@@ -44,6 +44,22 @@ PreCommit:
# on_warn: fail # Treat all warnings as failures
ScssLint:
enabled: true
MarkdownLint:
enabled: true
description: 'Lint documentation for Markdown errors'
required_executable: 'node_modules/.bin/markdownlint'
flags: ['--config', '.markdownlint.json', 'doc/**/*.md']
install_command: 'yarn install'
include:
- 'doc/**/*.md'
Vale:
enabled: true
description: 'Lint documentation for grammatical and formatting errors'
required_executable: 'vale'
flags: ['--config', '.vale.ini', '--minAlertLevel', 'error', 'doc']
install_command: 'brew install vale # (or use another package manager)'
include:
- 'doc/**/*.md'
CommitMsg:
TextWidth:
...
...
doc/.vale/gitlab/spelling-exceptions.txt
View file @
0144afa7
...
...
@@ -387,6 +387,7 @@ reverify
Rubix
Rubocop
Rubular
ruleset
runbook
runbooks
runit
...
...
doc/development/contributing/style_guides.md
View file @
0144afa7
...
...
@@ -10,26 +10,23 @@ we suggest investigating to see if a plugin exists. For instance here is the
## Pre-commit static analysis
You're strongly advised to install
[
Overcommit
](
https://github.com/sds/overcommit
)
to automatically check for
You should install
[
`overcommit`
](
https://github.com/sds/overcommit
)
to automatically check for
static analysis offenses before committing locally.
In your GitLab source directory run
:
After installing
`overcommit`
, run the following in your GitLab source directory
:
```
shell
make
-C
tooling/overcommit
```
Then before a commit is created,
Overcommit will automatically check for
RuboCop (and other checks)
offenses on every modified file.
Then before a commit is created,
`overcommit`
automatically checks for RuboCop (and other checks)
offenses on every modified file.
This saves you time as you don't have to wait for the same errors to be detected
by the CI.
This saves you time as you don't have to wait for the same errors to be detected by CI/CD.
Overcommit relies on a pre-commit hook to prevent commits that violate its ruleset.
If you wish to override this behavior, it can be done by passing the ENV variable
`OVERCOMMIT_DISABLE`
; i.e.
`OVERCOMMIT_DISABLE=1 git rebase master`
to rebase while
disabling the Git hook.
`overcommit`
relies on a pre-commit hook to prevent commits that violate its ruleset. To override
this behavior, pass the
`OVERCOMMIT_DISABLE`
environment variable. For example,
`OVERCOMMIT_DISABLE=1 git rebase master`
to rebase while disabling the Git hook.
## Ruby, Rails, RSpec
...
...
doc/development/documentation/index.md
View file @
0144afa7
...
...
@@ -624,6 +624,7 @@ You can use markdownlint:
- [On the command line](https://github.com/igorshubovych/markdownlint-cli#markdownlint-cli--).
- [Within a code editor](#configure-editors).
- [In a `pre-commit` hook](#configure-pre-commit-hooks).
#### Vale
...
...
@@ -650,6 +651,9 @@ You can use Vale:
- [On the command line](https://errata-ai.gitbook.io/vale/getting-started/usage).
- [Within a code editor](#configure-editors).
- [In a `pre-commit` hook](#configure-pre-commit-hooks). Vale only reports errors in the
`pre-commit` hook (the same configuration as the CI/CD pipelines), and does not report suggestions
or warnings.
#### Install linters
...
...
@@ -703,6 +707,22 @@ To configure Vale within your editor, install one of the following as appropriat
We don't use [Vale Server](https://errata-ai.github.io/vale/#using-vale-with-a-text-editor-or-another-third-party-application).
#### Configure pre-commit hooks
Git [pre-commit hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) allow Git users to
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,
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)
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-commit-static-analysis).
#### Disable Vale tests
You can disable a specific Vale linting rule or all Vale linting rules for any portion of a
...
...
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