diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c0934af..f6c1802 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,7 +40,7 @@ variables: # See the documentation here: # # https://wayland.freedesktop.org/libinput/doc/latest/building_libinput.html # ############################################################################### - FEDORA_PACKAGES: 'git diffutils gcc gcc-c++ pkgconf-pkg-config systemd-devel libxkbcommon-devel libxml2 doxygen python3-pytest python3-dbusmock python3-jinja2 python3-pip python3-pyyaml golang libabigail ' + FEDORA_PACKAGES: 'git diffutils gcc gcc-c++ pkgconf-pkg-config systemd-devel libxkbcommon-devel libxml2 doxygen python3-pytest python3-dbusmock python3-jinja2 python3-pip python3-pyyaml golang libabigail clang-tools-extra ' FEDORA_PIP_PACKAGES: 'meson ninja structlog strenum ' DEBIAN_PACKAGES: 'git gcc g++ pkg-config libsystemd-dev libxkbcommon-dev libxml2 doxygen python3-pytest python3-dbusmock python3-jinja2 python3-pip python3-yaml ' DEBIAN_PIP_PACKAGES: 'meson ninja structlog strenum ' @@ -50,8 +50,8 @@ variables: # changing these will force rebuilding the associated image # Note: these tags have no meaning and are not tied to a particular # libinput version - FEDORA_TAG: '2025-05-19.1' - DEBIAN_TAG: '2025-05-19.1' + FEDORA_TAG: '2026-05-13.0' + DEBIAN_TAG: '2026-05-13.0' FDO_UPSTREAM_REPO: libinput/libei @@ -200,6 +200,21 @@ debian:bullseye@container-prep: junit: $MESON_BUILDDIR/meson-logs/.junit.xml dependencies: [] +# Format C source files with clang-format +# +clang-format@fedora:43: + extends: + - .fdo.distribution-image@fedora + - .policy + stage: build + variables: + FDO_DISTRIBUTION_VERSION: '43' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + needs: + - "fedora:43@container-prep" + script: + - clang-format --dry-run --Werror src/*.[ch] test/*.[ch] tools/*.[ch] + # # Fedora # diff --git a/.gitlab-ci/ci.template b/.gitlab-ci/ci.template index 00097c6..4a790e5 100644 --- a/.gitlab-ci/ci.template +++ b/.gitlab-ci/ci.template @@ -198,6 +198,24 @@ python-ruff: junit: $MESON_BUILDDIR/meson-logs/.junit.xml dependencies: [] +# Format C source files with clang-format +# +{% for distro in distributions if distro.use_for_custom_build_tests %} +{% set version = "{}".format(distro.versions|last()) %} +clang-format@{{distro.name}}:{{version}}: + extends: + - .fdo.distribution-image@{{distro.name}} + - .policy + stage: build + variables: + FDO_DISTRIBUTION_VERSION: '{{version}}' + FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG + needs: + - "{{distro.name}}:{{version}}@container-prep" + script: + - clang-format --dry-run --Werror src/*.[ch] test/*.[ch] tools/*.[ch] +{% endfor %} + # # Fedora # diff --git a/.gitlab-ci/config.yml b/.gitlab-ci/config.yml index 469649e..4a17c8c 100644 --- a/.gitlab-ci/config.yml +++ b/.gitlab-ci/config.yml @@ -3,7 +3,7 @@ # # We're happy to rebuild all containers when one changes. -.default_tag: &default_tag '2025-05-19.1' +.default_tag: &default_tag '2026-05-13.0' last_abi_break: abe85e051e7029bfd2e7913ab980a9e0042b6d0d minimum_meson_version: 0.57.0 @@ -31,6 +31,7 @@ distributions: - python3-pyyaml - golang # for documentation only - libabigail # for abidiff only + - clang-tools-extra # for clang-format pips: - meson - ninja diff --git a/tools/oeffis-demo-tool.c b/tools/oeffis-demo-tool.c index 8242761..5e2754e 100644 --- a/tools/oeffis-demo-tool.c +++ b/tools/oeffis-demo-tool.c @@ -82,7 +82,9 @@ start_demo_client(int fd) _cleanup_free_ char *fdstr = xaprintf("%d", fd); execl(MESON_BUILDDIR "/ei-demo-client", "ei-demo-client", - "--socketfd", fdstr, NULL); + "--socketfd", + fdstr, + NULL); fprintf(stderr, "Failed to fork: %m\n"); exit(1); } @@ -116,9 +118,9 @@ main(int argc, char **argv) OPT_CLIENT, }; static struct option long_opts[] = { - {"client", required_argument, 0, OPT_CLIENT}, - {"help", no_argument, 0, 'h'}, - {.name = NULL}, + { "client", required_argument, 0, OPT_CLIENT }, + { "help", no_argument, 0, 'h' }, + { .name = NULL }, }; int optind = 0; @@ -126,7 +128,7 @@ main(int argc, char **argv) if (c == -1) break; - switch(c) { + switch (c) { case 'h': usage(stdout, argv[0]); return EXIT_SUCCESS;