ci: Update shared scripts and dot files to 0ed15ed
This commit is contained in:
committed by
Guido Günther
parent
73d5a02bfc
commit
fe17c6d5ee
+6
-1
@@ -5,6 +5,9 @@
|
|||||||
(c-basic-offset . 2)
|
(c-basic-offset . 2)
|
||||||
(display-fill-column-indicator-column . 100)
|
(display-fill-column-indicator-column . 100)
|
||||||
))
|
))
|
||||||
|
(rust-mode . (
|
||||||
|
(indent-tabs-mode . nil)
|
||||||
|
))
|
||||||
(setq auto-mode-alist (cons '("\\.ui$" . nxml-mode) auto-mode-alist))
|
(setq auto-mode-alist (cons '("\\.ui$" . nxml-mode) auto-mode-alist))
|
||||||
(nxml-mode . (
|
(nxml-mode . (
|
||||||
(indent-tabs-mode . nil)
|
(indent-tabs-mode . nil)
|
||||||
@@ -16,5 +19,7 @@
|
|||||||
(indent-tabs-mode . nil)
|
(indent-tabs-mode . nil)
|
||||||
(js-indent-level . 2)
|
(js-indent-level . 2)
|
||||||
))
|
))
|
||||||
|
(meson-mode . (
|
||||||
|
(indent-tabs-mode . nil)
|
||||||
|
))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+8
-7
@@ -4,32 +4,33 @@ root = true
|
|||||||
charset = utf-8
|
charset = utf-8
|
||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
max_line_length = 100
|
||||||
|
|
||||||
[meson.build]
|
[meson.build]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
tab_size = 2
|
tab_size = 2
|
||||||
indent_style = space
|
indent_style = space
|
||||||
|
|
||||||
[*.{c,h,h.in}]
|
[*.{c,h,c.in,h.in}]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
tab_size = 2
|
tab_size = 2
|
||||||
indent_style = space
|
indent_style = space
|
||||||
max_line_length = 80
|
|
||||||
|
|
||||||
[*.css]
|
[*.css]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
tab_size = 2
|
tab_size = 2
|
||||||
indent_style = space
|
indent_style = space
|
||||||
|
|
||||||
[*.xml]
|
|
||||||
indent_size = 2
|
|
||||||
tab_size = 2
|
|
||||||
indent_style = space
|
|
||||||
|
|
||||||
[*.json]
|
[*.json]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
tab_size = 2
|
tab_size = 2
|
||||||
indent_style = space
|
indent_style = space
|
||||||
|
|
||||||
|
[*.{xml,ui}]
|
||||||
|
indent_size = 2
|
||||||
|
tab_size = 2
|
||||||
|
indent_style = space
|
||||||
|
|
||||||
[NEWS]
|
[NEWS]
|
||||||
max_line_length = 72
|
max_line_length = 72
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
include:
|
include:
|
||||||
- remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/34039cd573a2df832d465bc9e4c5f543571f5241/templates/ci-fairy.yml'
|
- remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/34039cd573a2df832d465bc9e4c5f543571f5241/templates/ci-fairy.yml'
|
||||||
- remote: 'https://gitlab.gnome.org/guidog/meta-phosh/-/raw/f3c92e90dcc0d65322888217429b75dd101bd0d3/ci/phosh-common-jobs.yml'
|
- remote: 'https://gitlab.gnome.org/guidog/meta-phosh/-/raw/0ed15edd821f8afacbf7a9c0f2a6266873289115/ci/phosh-common-jobs.yml'
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
|
|||||||
Executable
+102
@@ -0,0 +1,102 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright (C) 2024 The Phosh developers
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
# Author: Guido Günther <agx@sigxcpu.org>
|
||||||
|
#
|
||||||
|
# Check if NEWS, changelog, meson and metainfo are in sync
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
COLOR=
|
||||||
|
if [ -n "${TERM}" ] && [ "${TERM}" != "dumb" ]; then
|
||||||
|
COLOR=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
function log
|
||||||
|
{
|
||||||
|
local level="${1}"
|
||||||
|
local fd=2
|
||||||
|
local use_color
|
||||||
|
|
||||||
|
shift
|
||||||
|
if [ -n "${COLOR}" ]; then
|
||||||
|
[ "${level}" == warn ] || [ "${level}" == error ] || fd=1
|
||||||
|
! [ -t "${fd}" ] || use_color=1
|
||||||
|
|
||||||
|
if [ -n "${use_color}" ]; then
|
||||||
|
case "${level}" in
|
||||||
|
warn)
|
||||||
|
tput setaf 1
|
||||||
|
;;
|
||||||
|
error)
|
||||||
|
tput bold; tput setaf 1
|
||||||
|
;;
|
||||||
|
info)
|
||||||
|
tput setaf 2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$@"
|
||||||
|
|
||||||
|
[ -z "${use_color}" ] || tput sgr0
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if [ -f debian/changelog ]; then
|
||||||
|
log info "Fetching version from d/changelog"
|
||||||
|
VERSION=$(dpkg-parsechangelog -SVersion)
|
||||||
|
elif [ -f meson.build ]; then
|
||||||
|
log info "Fetching version from meson build file"
|
||||||
|
VERSION=$(sed -n "s/.*version\s*:\s*'\([0-9].*\)'.*/\1/p" meson.build)
|
||||||
|
else
|
||||||
|
log error "E: Don't know how to get version information"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "I: Checking for '${VERSION}'"
|
||||||
|
|
||||||
|
# News
|
||||||
|
if ! head -1 NEWS | grep -E -qs "\s+${VERSION}\s*$"; then
|
||||||
|
log error "E: Version ${VERSION} not in NEWS file"
|
||||||
|
if [[ "${VERSION}" =~ (~|-)dev ]]; then
|
||||||
|
log info "I: Unreleased development version, no need to check NEWS"
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
log info "I: Found matching news entry"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# meson.build
|
||||||
|
MESON_VERSION="${VERSION/\~/.}"
|
||||||
|
if [ -f meson.build ]; then
|
||||||
|
if ! grep -qs "version\s*:\s*'$MESON_VERSION'" meson.build; then
|
||||||
|
log error "E: Version ${MESON_VERSION} not in meson.build file"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
log info "I: Found matching meson version entry"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
log info "I: no meson project"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# appstream info
|
||||||
|
METAINFO=$(ls data/*metainfo.xml.in* 2>/dev/null || true)
|
||||||
|
if [ -z "${METAINFO}" ]; then
|
||||||
|
log warn "W: No metainfo"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! grep -qs "$MESON_VERSION\"" "${METAINFO}"; then
|
||||||
|
log error "E: Version ${MESON_VERSION} not in metainfo ${METAINFO}"
|
||||||
|
if [[ "${VERSION}" =~ (~|-)(alpha|beta|dev|rc) ]]; then
|
||||||
|
log info "I: Not a stable release, no metainfo is fine"
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
log info "I: Found matching metainfo entry"
|
||||||
|
fi
|
||||||
Executable
+39
@@ -0,0 +1,39 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright (C) 2025 The Phosh developers
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
#
|
||||||
|
# Author: Guido Günther <agx@sigxcpu.org>
|
||||||
|
|
||||||
|
ret=0
|
||||||
|
|
||||||
|
TMPDIR=$(mktemp -d)
|
||||||
|
|
||||||
|
# We check files individually so we can print the diff:
|
||||||
|
while IFS= read -r -d '' file; do
|
||||||
|
if ! meson format -e --check-only "$file"; then
|
||||||
|
echo
|
||||||
|
echo "Meson file '${file}' needs reformat:"
|
||||||
|
meson format -e "$file" > "${TMPDIR}/meson.build"
|
||||||
|
diff -u "$file" "${TMPDIR}/meson.build"
|
||||||
|
rm -f "${TMPDIR}/meson.build"
|
||||||
|
ret=1
|
||||||
|
fi
|
||||||
|
done < <(find . -name '*.build' -print0)
|
||||||
|
|
||||||
|
if [ -n "$TMPDIR" ]; then
|
||||||
|
rmdir "${TMPDIR}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $ret -ne 0 ]; then
|
||||||
|
cat <<EOF
|
||||||
|
|
||||||
|
To reformat all files run:
|
||||||
|
|
||||||
|
meson format -e --recursive --inplace
|
||||||
|
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit $ret
|
||||||
+5
-1
@@ -1,11 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright (C) 2024 The Phosh developers
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
# Author: Guido Günther <agx@sigxcpu.org>
|
||||||
|
|
||||||
cd po/ || exit 1
|
cd po/ || exit 1
|
||||||
# barf on untranslated C files. Seems intltool
|
# barf on untranslated C files. Seems intltool
|
||||||
# can't be told to exit with non-zero exit status
|
# can't be told to exit with non-zero exit status
|
||||||
# in this case
|
# in this case
|
||||||
|
|
||||||
if intltool-update -m 2>&1 | grep -E -qs '/.*\.(c|ui)'; then
|
if intltool-update -m 2>&1 | grep -E -qs '/.*\.(c|ui|in)'; then
|
||||||
intltool-update -m
|
intltool-update -m
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -110,6 +110,8 @@ sp_cmt_cpp_start = add
|
|||||||
#
|
#
|
||||||
# Add or remove space between #else or #endif and a trailing comment.
|
# Add or remove space between #else or #endif and a trailing comment.
|
||||||
sp_endif_cmt = add
|
sp_endif_cmt = add
|
||||||
|
# Offset value that controls the indentation of the body of a multiline #define
|
||||||
|
pp_multiline_define_body_indent = 2
|
||||||
|
|
||||||
# Newlines at the start and end of the file.
|
# Newlines at the start and end of the file.
|
||||||
nl_start_of_file = remove
|
nl_start_of_file = remove
|
||||||
@@ -143,3 +145,4 @@ sp_before_sparen = add
|
|||||||
# Add spaces around assignments and arithmethic operators
|
# Add spaces around assignments and arithmethic operators
|
||||||
sp_assign = add
|
sp_assign = add
|
||||||
sp_arith = add
|
sp_arith = add
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user