Skip to content

Commit

Permalink
do not touch yamllint.yml in ansible-lint helper (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
richm authored Jun 3, 2024
1 parent 933931b commit c7f283e
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/tox_lsr/test_scripts/ansible-lint-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ SCRIPTDIR=$(readlink -f "$(dirname "$0")")
. "${SCRIPTDIR}/utils.sh"

role=$(basename "${TOPDIR}")
yl=.yamllint.yml
yl_bkup="$LSR_TOX_ENV_TMP_DIR/.yamllint.yml.backup"
mm=meta/main.yml
mm_bkup="$LSR_TOX_ENV_TMP_DIR/meta_main.yml.backup"

Expand All @@ -25,22 +23,12 @@ pre() {
sed "/galaxy_info:/a\ role_name: $role" -i "$mm"
fi
fi
if [ -f "$yl" ]; then
cp -p "$yl" "$yl_bkup"
if grep -q "^extends: yamllint_defaults.yml$" "$yl"; then
sed "/^extends: yamllint_defaults.yml$/s,yamllint_defaults.yml,${LSR_CONFIGDIR}/yamllint_defaults.yml," \
-i "$yl"
fi
fi
}

post() {
if [ -f "$mm_bkup" ]; then
mv "$mm_bkup" "$mm"
fi
if [ -f "$yl_bkup" ]; then
mv "$yl_bkup" "$yl"
fi
}

"$@"

0 comments on commit c7f283e

Please sign in to comment.