From fcc59c48304c4ced76d813b0c1e500a0f4aace19 Mon Sep 17 00:00:00 2001 From: flokoe Date: Wed, 26 Jul 2023 20:18:22 +0200 Subject: [PATCH] Add editorconfig and fix formatting --- .editorconfig | 19 +++++++++++++++++++ .github/workflows/release.yaml | 2 +- src/puppet/devcontainer-feature.json | 2 +- src/puppet/install.sh | 11 +++++------ test/puppet/latest_puppet_version.sh | 4 ++-- test/puppet/scenarios.json | 2 +- test/puppet/specific_puppet_version.sh | 2 +- test/puppet/test.sh | 2 +- 8 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..93b74e0 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# https://editorconfig.org/ + + +root = true + +[*] +indent_style = space +indent_size = 4 + +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 100 + +[*.md] +trim_trailing_whitespace = false diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 935ef81..b8a2389 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -19,7 +19,7 @@ jobs: publish-features: "true" base-path-to-features: "./src" generate-docs: "true" - + env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/src/puppet/devcontainer-feature.json b/src/puppet/devcontainer-feature.json index f0c9317..c1afe7a 100644 --- a/src/puppet/devcontainer-feature.json +++ b/src/puppet/devcontainer-feature.json @@ -32,4 +32,4 @@ "installsAfter": [ "ghcr.io/devcontainers/features/common-utils" ] -} \ No newline at end of file +} diff --git a/src/puppet/install.sh b/src/puppet/install.sh index d540a82..baef5bc 100644 --- a/src/puppet/install.sh +++ b/src/puppet/install.sh @@ -45,18 +45,17 @@ receive_gpg_keys() { export GNUPGHOME="/tmp/tmp-gnupg" mkdir -p ${GNUPGHOME} chmod 700 ${GNUPGHOME} - echo -e "disable-ipv6\n${GPG_KEY_SERVERS}" > ${GNUPGHOME}/dirmngr.conf + echo -e "disable-ipv6\n${GPG_KEY_SERVERS}" >${GNUPGHOME}/dirmngr.conf # GPG key download sometimes fails for some reason and retrying fixes it. local retry_count=0 local gpg_ok="false" set +e - until [ "${gpg_ok}" = "true" ] || [ "${retry_count}" -eq "5" ]; - do + until [ "${gpg_ok}" = "true" ] || [ "${retry_count}" -eq "5" ]; do echo "(*) Downloading GPG key..." - ( echo "${keys}" | xargs -n 1 gpg -q ${keyring_args} --recv-keys) 2>&1 && gpg_ok="true" + (echo "${keys}" | xargs -n 1 gpg -q ${keyring_args} --recv-keys) 2>&1 && gpg_ok="true" if [ "${gpg_ok}" != "true" ]; then echo "(*) Failed getting key, retring in 10s..." - (( retry_count++ )) + ((retry_count++)) sleep 10s fi done @@ -83,7 +82,7 @@ check_packages() { } if [[ $PUPPET_VERSION == "latest" ]]; then - lates_version="$(git ls-remote --tags https://github.com/puppetlabs/puppet |grep -oP '\d+\.\d+\.\d+$' | sort -V |tail -n1 |cut -d '.' -f1)" + lates_version="$(git ls-remote --tags https://github.com/puppetlabs/puppet | grep -oP '\d+\.\d+\.\d+$' | sort -V | tail -n1 | cut -d '.' -f1)" PUPPET_VERSION=$lates_version echo "Latest version was selected. Going to install Puppet ${PUPPET_VERSION}." fi diff --git a/test/puppet/latest_puppet_version.sh b/test/puppet/latest_puppet_version.sh index e4e39ce..38ae6c8 100644 --- a/test/puppet/latest_puppet_version.sh +++ b/test/puppet/latest_puppet_version.sh @@ -10,7 +10,7 @@ source dev-container-features-test-lib # Feature-specific tests # The 'check' command comes from the dev-container-features-test-lib. Syntax is... # check