Merge pull request #2854 from cgwalters/clang-format-prep

This commit is contained in:
Jonathan Lebon 2023-05-01 16:48:26 -04:00 committed by GitHub
commit dd70c9b78c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 41 additions and 20 deletions

4
.clang-format Normal file
View File

@ -0,0 +1,4 @@
Language: Cpp
BasedOnStyle: GNU
ColumnLimit: 100
ForEachMacros: ['GLNX_HASH_TABLE_FOREACH', 'GLNX_HASH_TABLE_FOREACH_V', 'GLNX_HASH_TABLE_FOREACH_KV', 'GLNX_HASH_TABLE_FOREACH_IT']

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <https://www.gnu.org/licenses/>.
# This needs to be outside the conditional to avoid a warning
.PHONY: manhtml
if ENABLE_MAN
# If you add a new man page here, add a reference to it in index.xml and
@ -65,7 +68,6 @@ noinst_DATA += $(manhtml_files)
# Convenience target for building the just the HTML man pages
manhtml: $(manhtml_files)
.PHONY: manhtml
endif
EXTRA_DIST += man/index.xml $(man1_MANS:.1=.xml) $(man5_MANS:.5=.xml)

View File

@ -132,6 +132,10 @@ include Makefile-bash.am
release-tag:
cd $(srcdir) && git $(srcdir) tag -m "Release $(VERSION)" v$(VERSION)
.PHONY: clang-format
clang-format:
git ls-files '**.c' '**.cxx' '**.h' '**.hpp' | xargs clang-format -i
embed_dependency=tar -C $(srcdir) --append --exclude='.git/*' --transform="s,^embedded-dependencies/,ostree-embeddeps-$${GITVERSION}/embedded-dependencies/," --file=$${TARFILE_TMP}
git_version_rpm = $$(cd $(srcdir) && git describe | sed -e 's,-,\.,g' -e 's,^v,,')

View File

@ -15,6 +15,13 @@ done
echo "ok"
fi
# Will uncomment this once we reformat
#if command -v clang-format; then
# echo -n "checking clang-format... "
# git ls-files '**.c' '**.cxx' '**.h' '**.hpp' | xargs clang-format --Werror --dry-run
# echo "ok"
#fi
echo -n 'grep-based static analysis... '
patterns=(glnx_fd_close)
for pat in "${patterns[@]}"; do

View File

@ -71,6 +71,7 @@ case "$ID" in
build-essential
bubblewrap
ca-certificates
clang-format
cpio
debhelper
dh-exec

View File

@ -22,7 +22,7 @@ pkg_install rpm-ostree && rpm -e rpm-ostree
pkg_install ostree{,-devel,-grub2} createrepo_c /usr/bin/jq python3-pyyaml \
libubsan libasan libtsan elfutils fuse sudo python3-gobject-base \
selinux-policy-devel selinux-policy-targeted python3-createrepo_c \
rsync python3-rpm parallel clang rustfmt-preview
rsync python3-rpm parallel clang rustfmt-preview clang-tools-extra
# From rpm-ostree/ci/vmcheck-provision.sh
pkg_install openssh-clients ansible

View File

@ -16,6 +16,7 @@
*/
#include "config.h"
#include "ostree-bootloader.h"
G_DEFINE_INTERFACE (OstreeBootloader, _ostree_bootloader, G_TYPE_OBJECT)

View File

@ -17,7 +17,8 @@
#pragma once
#include <gio/gio.h>
#include <ostree.h>
#include "otutil.h"
G_BEGIN_DECLS

View File

@ -19,10 +19,9 @@
#include "config.h"
#include <string.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gunixoutputstream.h>
#include <gio/gmemoryoutputstream.h>
#include "ostree-core-private.h"
#include "ostree-repo-private.h"

View File

@ -20,26 +20,28 @@
#pragma once
#include <ostree-async-progress.h>
#include <ostree-bootconfig-parser.h>
#include <ostree-content-writer.h>
#include <ostree-core.h>
#include <ostree-repo.h>
#include <ostree-repo-os.h>
#include <ostree-mutable-tree.h>
#include <ostree-remote.h>
#include <ostree-repo-file.h>
#include <ostree-sysroot.h>
#include <ostree-sysroot-upgrader.h>
#include <ostree-deployment.h>
#include <ostree-bootconfig-parser.h>
#include <ostree-diff.h>
#include <ostree-gpg-verify-result.h>
#include <ostree-kernel-args.h>
#include <ostree-mutable-tree.h>
#include <ostree-ref.h>
#include <ostree-repo-finder.h>
#include <ostree-remote.h>
#include <ostree-repo-file.h>
#include <ostree-repo-finder-avahi.h>
#include <ostree-repo-finder-config.h>
#include <ostree-repo-finder-mount.h>
#include <ostree-repo-finder-override.h>
#include <ostree-kernel-args.h>
#include <ostree-repo-finder.h>
#include <ostree-repo-os.h>
#include <ostree-repo.h>
#include <ostree-sign.h>
#include <ostree-autocleanups.h>
#include <ostree-sysroot-upgrader.h>
#include <ostree-sysroot.h>
#include <ostree-version.h>
// Include after type definitions
#include <ostree-autocleanups.h>

View File

@ -27,7 +27,6 @@
#include <string.h>
#include <unistd.h>
#include "ot-main.h"
#include "ot-builtins.h"
static OstreeCommand commands[] = {

View File

@ -21,7 +21,7 @@
#pragma once
#include <ostree.h>
#include "ot-main.h"
G_BEGIN_DECLS

View File

@ -19,7 +19,7 @@
#pragma once
#include <ostree.h>
#include "ot-main.h"
G_BEGIN_DECLS

View File

@ -20,7 +20,7 @@
#pragma once
#include <ostree.h>
#include "ot-main.h"
G_BEGIN_DECLS

View File

@ -24,6 +24,7 @@
#include "config.h"
#include "ostree.h"
#include "ot-main.h"
G_BEGIN_DECLS