Skip to content

Make it easy to run clang-tidy and clang-format inside Docker #225

@StevenMaude

Description

@StevenMaude

The build happens in Docker, so we should run these tools inside Docker for simplicity. It would be useful to catch issues introduced when updating the code to be able to use newer versions of Poppler.

Manual steps to run clang-tidy:

  1. Copy the clang_compilation_database.py from the Waf source to the root of this repository. link to master version 1
  2. In the Dockerfile, add clang16-extra-tools to the list of Alpine packages to be installed.
  3. In the Dockerfile, add the clang_compilation_database.py to the Dockerfile COPY.
  4. Build the image.
  5. Run a container from the image: docker run -ti --entrypoint /bin/sh <IMAGE_ID>
  6. $ cp ./build/compile_commands.json . && cd ..
  7. $ clang-tidy -p compile_commands.json src/*.cpp src/*.h

TODO:

  • how to ignore specific files? (syscall-reporter.cpp)
  • fix actual issues that clang-tidy flags
  • which version of clang are we using already?
  • rebuild waf adding the clang_compilation_database tool

Footnotes

  1. Version at time of writing in case the master link breaks;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions