Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
spbro
OpenXG-RAN
Commits
b8401a18
Commit
b8401a18
authored
Oct 01, 2024
by
Jaroslava Fiedlerova
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/clang-format-tool' into integration_2024_w40
parents
a700da57
771d11a1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
0 deletions
+48
-0
doc/clang-format.md
doc/clang-format.md
+4
-0
tools/formatting/README.md
tools/formatting/README.md
+26
-0
tools/formatting/detect_clang_format_errors.sh
tools/formatting/detect_clang_format_errors.sh
+5
-0
tools/formatting/docker-compose.yaml
tools/formatting/docker-compose.yaml
+13
-0
No files found.
doc/clang-format.md
View file @
b8401a18
...
...
@@ -64,3 +64,7 @@ When this is done, you are set up. How to use:
6) Commit. It won't work if code is not properly formatted due to the
pre-commit hook. Force committing with
`git commit --no-verify`
# Checking errors introduced by a branch
Here is the script that can be used to detect any clang-format errors introduced by a branch
[
here
](
../tools/formatting/README.md
)
tools/formatting/README.md
0 → 100644
View file @
b8401a18
# Overview
Dockerized tool to list clang-format errors introduced in a branch.
# Usage
Checkout the branch you want to compare. This is necessary because if there are files added by the branch
they need to be present for clang-format to analyze them.
Then:
```
./tools/formatting/detect_clang_format_errors.sh
```
Or
```
docker compose up
```
Or (to avoid docker related lines in stdout)
```
docker compose run clang-formatter | tee output
```
tools/formatting/detect_clang_format_errors.sh
0 → 100755
View file @
b8401a18
#!/bin/bash
set
-eo
pipefail
BASE_COMMIT
=
$(
git merge-base HEAD origin/develop
)
git diff
-U0
--no-color
$BASE_COMMIT
...HEAD | clang-format-diff
-p1
tools/formatting/docker-compose.yaml
0 → 100644
View file @
b8401a18
services
:
clang-formatter
:
image
:
clang-formatter
build
:
dockerfile_inline
:
|
FROM ubuntu:22.04
RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y git clang-format
volumes
:
-
../../:/code/
command
:
bash -c "git config --global --add safe.directory /code && cd /code/ && \
git config --global clangFormat.style file && \
./tools/formatting/detect_clang_format_errors.sh"
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