Skip to content

docs: update readme to use v19 as example #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG CLANG_VERSION

LABEL \
org.opencontainers.image.vendor="cpp-linter team" \
org.opencontainers.image.title="Unofficial Clang Tools Docker image" \
org.opencontainers.image.title="Clang Tools Docker image" \
org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." \
org.opencontainers.image.version="clang-tools:${CLANG_VERSION}" \
org.opencontainers.image.url="https://hub.docker.com/r/xianpengshen/clang-tools" \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.all
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM $BASE_IMAGE

LABEL \
org.opencontainers.image.vendor="cpp-linter team" \
org.opencontainers.image.title="Unofficial Clang Tools Docker image" \
org.opencontainers.image.title="Clang Tools Docker image" \
org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." \
org.opencontainers.image.version="clang-tools:all" \
org.opencontainers.image.url="https://hub.docker.com/r/xianpengshen/clang-tools" \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG CLANG_VERSION

LABEL \
org.opencontainers.image.vendor="cpp-linter team" \
org.opencontainers.image.title="Unofficial Clang Tools Docker image" \
org.opencontainers.image.title="Clang Tools Docker image" \
org.opencontainers.image.description="The Clang Tools Docker image includes the clang-format and clang-tidy." \
org.opencontainers.image.version="clang-tools:${CLANG_VERSION}" \
org.opencontainers.image.url="https://hub.docker.com/r/xianpengshen/clang-tools" \
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,25 @@ You can access all available Clang Tools Docker images via [Docker Hub registry

```bash
# Check clang-format version
$ docker run xianpengshen/clang-tools:17 clang-format --version
Ubuntu clang-format version 17.0.0 (+rc4-1~exp5ubuntu1)
$ docker run xianpengshen/clang-tools:19 clang-format --version
Ubuntu clang-format version 19.1.0 (1ubuntu1)
# Format code (helloworld.c in the demo directory)
$ docker run -v $PWD:/src xianpengshen/clang-tools:17 clang-format --dry-run -i helloworld.c
$ docker run -v $PWD:/src xianpengshen/clang-tools:19 clang-format --dry-run -i helloworld.c

# Check clang-tidy version
$ docker run xianpengshen/clang-tools:17 clang-tidy --version
Ubuntu LLVM version 17.0.0
$ docker run xianpengshen/clang-tools:19 clang-tidy --version
Ubuntu LLVM version 19.1.0
Optimized build.

# Diagnostic code (helloworld.c in the demo directory)
$ docker run -v $PWD:/src xianpengshen/clang-tools:17 clang-tidy helloworld.c \
$ docker run -v $PWD:/src xianpengshen/clang-tools:19 clang-tidy helloworld.c \
-checks=boost-*,bugprone-*,performance-*,readability-*,portability-*,modernize-*,clang-analyzer-cplusplus-*,clang-analyzer-*,cppcoreguidelines-*
```

### As base image in [`Dockerfile`](https://github.com/cpp-linter/clang-tools-docker/blob/master/demo/Dockerfile)

```Dockerfile
FROM xianpengshen/clang-tools:17
FROM xianpengshen/clang-tools:19

WORKDIR /src

Expand All @@ -68,13 +68,13 @@ $ docker build -t clang-tools .

# Check clang-format version
$ docker run clang-tools clang-format --version
Ubuntu clang-format version 17.0.0 (+rc4-1~exp5ubuntu1)
Ubuntu clang-format version 17.0.2 (1~exp1ubuntu2.1)
# Format code
$ docker run clang-tools clang-format --dry-run -i helloworld.c

# Check clang-tidy version
$ docker run clang-tools clang-tidy --version
Ubuntu LLVM version 17.0.0
Ubuntu LLVM version 19.1.0
Optimized build.
# Diagnostic code
$ docker run clang-tools clang-tidy helloworld.c \
Expand Down
Loading