Skip to content
Snippets Groups Projects
Commit 89823bc8 authored by Andrej Shadura's avatar Andrej Shadura
Browse files

Fix code formatting in add_linters_to_a_project

parent d88d91b2
No related branches found
No related tags found
1 merge request!8Fix code formatting in add_linters_to_a_project
Pipeline #122814 passed
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment