Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
apertis-website
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
docs
apertis-website
Commits
89823bc8
Commit
89823bc8
authored
5 years ago
by
Andrej Shadura
Browse files
Options
Downloads
Patches
Plain Diff
Fix code formatting in add_linters_to_a_project
parent
d88d91b2
No related branches found
Branches containing commit
No related tags found
1 merge request
!8
Fix code formatting in add_linters_to_a_project
Pipeline
#122814
passed
5 years ago
Stage: test
Stage: deploy
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
content/guidelines/add_linters_to_a_project.md
+21
-20
21 additions, 20 deletions
content/guidelines/add_linters_to_a_project.md
with
21 additions
and
20 deletions
content/guidelines/add_linters_to_a_project.md
+
21
−
20
View file @
89823bc8
...
...
@@ -18,11 +18,11 @@ shell can be easily done.
On an Apertis image or on Debian install the relevant packages:
`
apt
install
arcanist-clang-format-linter
pep8
shellcheck
`
apt
install
arcanist-clang-format-linter
pep8
shellcheck
Check the installation:
`
arc
linters
#
should
list
‘clang-format’
as
‘configured’
`
arc
linters
#
should
list
‘clang-format’
as
‘configured’
## Add a .clang-format file
...
...
@@ -31,12 +31,13 @@ options](http://clang.llvm.org/docs/ClangFormatStyleOptions.html) from a
hidden file, defined in YAML format. Create
`.clang-format`
and commit
it to git:
`# See `
<https://designs.apertis.org/latest/coding_conventions.html#code-formatting>
`BasedOnStyle: GNU`
`AlwaysBreakAfterDefinitionReturnType: All`
`BreakBeforeBinaryOperators: None`
`BinPackParameters: false`
`SpaceAfterCStyleCast: true`
See
<https://designs.apertis.org/latest/coding_conventions.html#code-formatting>
BasedOnStyle: GNU
AlwaysBreakAfterDefinitionReturnType: All
BreakBeforeBinaryOperators: None
BinPackParameters: false
SpaceAfterCStyleCast: true
These are the current recommended formatting options from the
[
coding
conventions
](
https://designs.apertis.org/latest/coding_conventions.html#code-formatting
)
,
...
...
@@ -88,15 +89,15 @@ PEP8](https://www.python.org/dev/peps/pep-0008/#imports).
To run the linters automatically on GitLab CI as soon as a Merge Request
is created, add a
`.gitlab-ci.yml`
file to the project:
` check_formatting:`
` image: debian:buster`
` stage: build`
` before_script:`
` - export DEBIAN_FRONTEND=noninteractive`
` - apt update`
` - apt install -y git-core arcanist-clang-format-linter pep8 shellcheck`
` script:`
` - cd "$CI_PROJECT_DIR"`
` - arc lint --rev "$(git merge-base origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME HEAD)" --never-apply-patches`
` only:`
` - merge_requests`
\ No newline at end of file
check_formatting:
image: debian:buster
stage: build
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt update
- apt install -y git-core arcanist-clang-format-linter pep8 shellcheck
script:
- cd "$CI_PROJECT_DIR"
- arc lint --rev "$(git merge-base origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME HEAD)" --never-apply-patches
only:
- merge_requests
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment