Skip to content

Commit d5c08da

Browse files
Merge #1090
1090: Add editorconfig file. r=Emilgardis a=Alexhuszagh Closes #1089. Co-authored-by: Alex Huszagh <[email protected]>
2 parents 1792621 + 67a60a6 commit d5c08da

19 files changed

+127
-102
lines changed

.editorconfig

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
7+
[*.{rs,py,sh,md,toml,yml,js}]
8+
charset = utf-8
9+
10+
[*.{rs,py,sh,yml,js}]
11+
trim_trailing_whitespace = true
12+
13+
[*.{rs,py,sh}]
14+
indent_style = space
15+
indent_size = 4
16+
17+
[*.yml]
18+
indent_style = space
19+
indent_size = 2
20+
21+
[Dockerfile.*]
22+
charset = utf-8
23+
trim_trailing_whitespace = true
24+
indent_style = space
25+
indent_size = 4

.github/ISSUE_TEMPLATE/b_issue_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ body:
9090
- label: Windows
9191
- label: Linux / BSD
9292
- label: other OS (specify in description)
93-
93+
9494
- type: checkboxes
9595
id: host-arch
9696
attributes:

.github/ISSUE_TEMPLATE/z_feature_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ body:
2020
description: |
2121
Write a description of what your feature would do.
2222
If you have an idea how to solve this, feel free to leave a comment on the feature request after creating it.
23-
23+
2424
If you have tried solved this but couldn't, explain what you tried and how or why it didn't work. We want to help!
2525
placeholder: |
2626
Examples:

ci/build_release.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ rm -rf "${BUILD_BINARIESDIRECTORY}"
1919
mkdir "${BUILD_BINARIESDIRECTORY}"
2020

2121
if [[ -f "target/${TARGET}/release/cross.exe" ]]; then
22-
mv "target/${TARGET}/release/cross.exe" "${BUILD_BINARIESDIRECTORY}/"
22+
mv "target/${TARGET}/release/cross.exe" "${BUILD_BINARIESDIRECTORY}/"
2323
else
24-
mv "target/${TARGET}/release/cross" "${BUILD_BINARIESDIRECTORY}/"
24+
mv "target/${TARGET}/release/cross" "${BUILD_BINARIESDIRECTORY}/"
2525
fi

ci/shared.sh

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,43 @@ CARGO_TMP_DIR="${PROJECT_HOME}/target/tmp"
88
export CARGO_TMP_DIR
99

1010
if [[ -n "${CROSS_CONTAINER_ENGINE}" ]]; then
11-
CROSS_ENGINE="${CROSS_CONTAINER_ENGINE}"
11+
CROSS_ENGINE="${CROSS_CONTAINER_ENGINE}"
1212
elif command -v docker >/dev/null 2>&1; then
13-
CROSS_ENGINE=docker
13+
CROSS_ENGINE=docker
1414
else
15-
CROSS_ENGINE=podman
15+
CROSS_ENGINE=podman
1616
fi
1717
export CROSS_ENGINE
1818

1919
function retry {
20-
local tries="${TRIES-5}"
21-
local timeout="${TIMEOUT-1}"
22-
local try=0
23-
local exit_code=0
20+
local tries="${TRIES-5}"
21+
local timeout="${TIMEOUT-1}"
22+
local try=0
23+
local exit_code=0
2424

25-
while (( try < tries )); do
26-
if "${@}"; then
27-
return 0
28-
else
29-
exit_code=$?
30-
fi
25+
while (( try < tries )); do
26+
if "${@}"; then
27+
return 0
28+
else
29+
exit_code=$?
30+
fi
3131

32-
sleep "${timeout}"
33-
echo "Retrying ..." 1>&2
34-
try=$(( try + 1 ))
35-
timeout=$(( timeout * 2 ))
36-
done
32+
sleep "${timeout}"
33+
echo "Retrying ..." 1>&2
34+
try=$(( try + 1 ))
35+
timeout=$(( timeout * 2 ))
36+
done
3737

38-
return ${exit_code}
38+
return ${exit_code}
3939
}
4040

4141
function mkcargotemp {
42-
local td=
43-
td="$CARGO_TMP_DIR"/$(mktemp -u "${@}" | xargs basename)
44-
mkdir -p "$td"
45-
echo '# Cargo.toml
46-
[workspace]
47-
members = ["'"$(basename "$td")"'"]
48-
' > "$CARGO_TMP_DIR"/Cargo.toml
49-
echo "$td"
42+
local td=
43+
td="$CARGO_TMP_DIR"/$(mktemp -u "${@}" | xargs basename)
44+
mkdir -p "$td"
45+
echo '# Cargo.toml
46+
[workspace]
47+
members = ["'"$(basename "$td")"'"]
48+
' > "$CARGO_TMP_DIR"/Cargo.toml
49+
echo "$td"
5050
}

ci/test.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ ci_dir=$(realpath "${ci_dir}")
1313
. "${ci_dir}"/shared.sh
1414

1515
workspace_test() {
16-
"${CROSS[@]}" build --target "${TARGET}" --workspace "$@" ${CROSS_FLAGS}
17-
"${CROSS[@]}" run --target "${TARGET}" -p binary "$@" ${CROSS_FLAGS}
18-
"${CROSS[@]}" run --target "${TARGET}" --bin dependencies \
19-
--features=dependencies "$@" ${CROSS_FLAGS}
16+
"${CROSS[@]}" build --target "${TARGET}" --workspace "$@" ${CROSS_FLAGS}
17+
"${CROSS[@]}" run --target "${TARGET}" -p binary "$@" ${CROSS_FLAGS}
18+
"${CROSS[@]}" run --target "${TARGET}" --bin dependencies \
19+
--features=dependencies "$@" ${CROSS_FLAGS}
2020
}
2121

2222
main() {

docker/Dockerfile.aarch64-unknown-linux-gnu.centos

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ COPY linux-runner base-runner.sh /
2929

3030
COPY aarch64-linux-gnu-glibc.sh /
3131
RUN /aarch64-linux-gnu-glibc.sh
32-
32+
3333
ENV CROSS_SYSROOT=/usr/aarch64-linux-gnu
3434
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
3535
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER="/linux-runner aarch64" \

docker/aarch64-linux-gnu-glibc.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,22 @@ main() {
4242
yum install -y epel-release
4343
yum install -y gcc-aarch64-linux-gnu gcc-c++-aarch64-linux-gnu binutils-aarch64-linux-gnu binutils gcc-c++ glibc-devel
4444
yum clean all
45-
45+
4646
local td
4747
td="$(mktemp -d)"
48-
48+
4949
pushd "${td}"
50-
50+
5151
local target=aarch64-linux-gnu
5252
local prefix="/usr/${target}"
5353
local kernel_v4="4.18.20"
54-
54+
5555
curl --retry 3 "https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/linux-${kernel_v4}.tar.xz" -O
5656
tar -xvf "linux-${kernel_v4}.tar.xz"
5757
pushd "linux-${kernel_v4}"
5858
make ARCH=arm64 INSTALL_HDR_PATH="${prefix}" headers_install
5959
popd
60-
60+
6161
curl --retry 3 http://ftp.gnu.org/gnu/glibc/glibc-2.17.tar.xz -O
6262
tar -xvf glibc-2.17.tar.xz
6363
mkdir build
@@ -76,13 +76,13 @@ main() {
7676
--with-headers="${prefix}/include" \
7777
--libdir="${prefix}/lib" \
7878
--libexecdir="${prefix}/lib"
79-
79+
8080
make -j && make install
8181
popd
8282

8383
mkdir -p "${prefix}"/{include,lib}
8484
mkdir -p "/usr/lib/gcc/aarch64-linux-gnu"/{4.8.2,4.8.5}
85-
85+
8686
mkdir libgcc
8787
pushd libgcc
8888
unpack_rpm "libgcc-4.8.5-44.el7.aarch64.rpm"
@@ -113,7 +113,7 @@ main() {
113113
# these are currently empty, but might contain content later
114114
mv "${redhat_485}/bits"/* "${cpp_485}/bits" || true
115115
mv "${redhat_485}/ext"/* "${cpp_485}/ext" || true
116-
116+
117117
popd
118118

119119
rm -rf "${td}"

docker/android-ndk.sh

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ NDK_URL=https://dl.google.com/android/repository/android-ndk-r21d-linux-x86_64.z
1010

1111
main() {
1212
local arch="${1}" \
13-
api="${2}"
13+
api="${2}"
1414

1515
install_packages curl unzip python
1616

@@ -23,32 +23,32 @@ main() {
2323
rm android-ndk-*.zip
2424
pushd android-ndk-*
2525
./build/tools/make_standalone_toolchain.py \
26-
--install-dir /android-ndk \
27-
--arch "${arch}" \
28-
--api "${api}"
26+
--install-dir /android-ndk \
27+
--arch "${arch}" \
28+
--api "${api}"
2929

3030
# clean up unused toolchains to reduce image size
3131
local triple
3232
local triples
3333
local triple_arch="${arch}"
3434
case "${arch}" in
35-
arm64)
36-
triple_arch="aarch64"
37-
;;
38-
x86)
39-
triple_arch="i686"
40-
;;
35+
arm64)
36+
triple_arch="aarch64"
37+
;;
38+
x86)
39+
triple_arch="i686"
40+
;;
4141
esac
4242
triples=(
43-
"aarch64-linux-android"
44-
"arm-linux-androideabi"
45-
"i686-linux-android"
46-
"x86_64-linux-android"
43+
"aarch64-linux-android"
44+
"arm-linux-androideabi"
45+
"i686-linux-android"
46+
"x86_64-linux-android"
4747
)
4848
for triple in "${triples[@]}"; do
49-
if ! [[ "${triple}" =~ ^"${triple_arch}".* ]]; then
50-
rm -rf "/android-ndk/sysroot/usr/lib/${triple}"
51-
fi
49+
if ! [[ "${triple}" =~ ^"${triple_arch}".* ]]; then
50+
rm -rf "/android-ndk/sysroot/usr/lib/${triple}"
51+
fi
5252
done
5353

5454
purge_packages

docker/dragonfly.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ set -euo pipefail
99
main() {
1010
local nproc=
1111
local binutils=2.32 \
12-
dragonfly=6.0.1_REL \
13-
gcc=10.3.0 \
14-
target=x86_64-unknown-dragonfly
12+
dragonfly=6.0.1_REL \
13+
gcc=10.3.0 \
14+
target=x86_64-unknown-dragonfly
1515
if [[ $# != "0" ]]; then
1616
nproc="${1}"
1717
fi

docker/dropbear.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ main() {
3636
sed -i '/failed to identify current user/d' cli-runopts.c
3737

3838
./configure \
39-
--disable-syslog \
40-
--disable-shadow \
41-
--disable-lastlog \
42-
--disable-utmp \
43-
--disable-utmpx \
44-
--disable-wtmp \
45-
--disable-wtmpx \
46-
--disable-pututline \
47-
--disable-pututxline
39+
--disable-syslog \
40+
--disable-shadow \
41+
--disable-lastlog \
42+
--disable-utmp \
43+
--disable-utmpx \
44+
--disable-wtmp \
45+
--disable-wtmpx \
46+
--disable-pututline \
47+
--disable-pututxline
4848

4949
make "-j$(nproc)" PROGRAMS=dbclient
5050
cp dbclient /usr/local/bin/

docker/freebsd.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ bsd_http="http://${bsd_ftp}"
4848

4949
main() {
5050
local binutils=2.32 \
51-
gcc=6.4.0 \
52-
target="${ARCH}-unknown-freebsd${BSD_MAJOR}"
51+
gcc=6.4.0 \
52+
target="${ARCH}-unknown-freebsd${BSD_MAJOR}"
5353

5454
install_packages ca-certificates \
5555
curl \

docker/linux-image.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ max_kernel_version() {
5757
main() {
5858
# arch in the rust target
5959
local arch="${1}" \
60-
kversion=5.10.0-16
60+
kversion=5.10.0-16
6161

6262
local debsource="deb http://http.debian.net/debian/ bullseye main"
6363
debsource="${debsource}\ndeb http://security.debian.org/ bullseye-security main"
@@ -204,8 +204,8 @@ main() {
204204
curl --retry 3 -sSfL 'https://www.ports.debian.org/archive_{2020,2021,2022}.key' -O
205205

206206
for key in *.asc *.key; do
207-
apt-key add "${key}"
208-
rm "${key}"
207+
apt-key add "${key}"
208+
rm "${key}"
209209
done
210210

211211
# allow apt-get to retry downloads

docker/mingw.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ main() {
2121

2222
local dependencies=(build-essential)
2323
while IFS='' read -r dep; do dependencies+=("${dep}"); done < \
24-
<(apt-cache showsrc gcc-mingw-w64-i686 | grep Build | cut -d: -f2 | tr , '\n' | cut -d' ' -f2 | sort | uniq)
24+
<(apt-cache showsrc gcc-mingw-w64-i686 | grep Build | cut -d: -f2 | tr , '\n' | cut -d' ' -f2 | sort | uniq)
2525

2626
install_packages "${dependencies[@]}"
2727

docker/musl.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ set -euo pipefail
99
hide_output() {
1010
set +x
1111
trap "
12-
echo 'ERROR: An error was encountered with the build.'
13-
cat /tmp/build.log
14-
exit 1
12+
echo 'ERROR: An error was encountered with the build.'
13+
cat /tmp/build.log
14+
exit 1
1515
" ERR
1616
bash -c 'while true; do sleep 30; echo $(date) - building ...; done' &
1717
PING_LOOP_PID=$!

docker/netbsd.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ set -euo pipefail
88

99
main() {
1010
local binutils=2.36.1 \
11-
gcc=9.4.0 \
12-
target=x86_64-unknown-netbsd
11+
gcc=9.4.0 \
12+
target=x86_64-unknown-netbsd
1313

1414
install_packages bzip2 \
1515
ca-certificates \

docker/qemu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ main() {
115115
if_centos version=4.2.1
116116

117117
local arch="${1}" \
118-
softmmu="${2:-}"
118+
softmmu="${2:-}"
119119

120120
install_packages \
121121
autoconf \

0 commit comments

Comments
 (0)