diff options
author | zsdc <taras@vyos.io> | 2022-03-25 20:58:01 +0200 |
---|---|---|
committer | zsdc <taras@vyos.io> | 2022-03-25 21:42:00 +0200 |
commit | 31448cccedd8f841fb3ac7d0f2e3cdefe08a53ba (patch) | |
tree | 349631a02467dae0158f6f663cc8aa8537974a97 /Makefile | |
parent | 5c4b3943343a85fbe517e5ec1fc670b3a8566b4b (diff) | |
parent | 8537237d80a48c8f0cbf8e66aa4826bbc882b022 (diff) | |
download | vyos-cloud-init-31448cccedd8f841fb3ac7d0f2e3cdefe08a53ba.tar.gz vyos-cloud-init-31448cccedd8f841fb3ac7d0f2e3cdefe08a53ba.zip |
T2117: Cloud-init updated to 22.1
Merged with 22.1 tag from the upstream Cloud-init repository.
Our modules were slightly modified for compatibility with the new
version.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 50 |
1 files changed, 42 insertions, 8 deletions
@@ -18,13 +18,10 @@ all: check check: check_version test yaml -style-check: pep8 $(pyflakes) +style-check: flake8 -pep8: - @$(CWD)/tools/run-pep8 - -pyflakes: - @$(CWD)/tools/run-pyflakes +flake8: + @$(CWD)/tools/run-flake8 unittest: clean_pyc python3 -m pytest -v tests/unittests cloudinit @@ -86,6 +83,43 @@ deb-src: doc: tox -e doc -.PHONY: test pyflakes clean pep8 rpm srpm deb deb-src yaml +# Spell check && filter false positives +_CHECK_SPELLING := find doc -type f -exec spellintian {} + | \ + grep -v -e 'doc/rtd/topics/cli.rst: modules modules' \ + -e 'doc/examples/cloud-config-mcollective.txt: WARNING WARNING' \ + -e 'doc/examples/cloud-config-power-state.txt: Bye Bye' \ + -e 'doc/examples/cloud-config.txt: Bye Bye' + + +# For CI we require a failing return code when spellintian finds spelling errors +check_spelling: + @! $(_CHECK_SPELLING) + +# Manipulate the output of spellintian into a valid "sed" command which is run +# to fix the error +# +# Example spellintian output: +# +# doc/examples/kernel-cmdline.txt: everthing -> everything +# +# The "fix_spelling" target manipulates the above output into the following command +# and runs that command. +# +# sed -i "s/everthing/everything/g" doc/examples/kernel-cmdline.txt +# +# awk notes: +# +# -F ': | -> ' means use the strings ": " or " -> " as field delimeters +# \046 is octal for double quote +# $$2 will contain the second field, ($ must be escaped because this is in a Makefile) +# +# Limitation: duplicate words with newline between them are not automatically fixed +fix_spelling: + @$(_CHECK_SPELLING) | \ + sed 's/ (duplicate word)//g' | \ + awk -F ': | -> ' '{printf "sed -i \047s/%s/%s/g\047 %s\n", $$2, $$3, $$1}' | \ + sh + +.PHONY: test flake8 clean rpm srpm deb deb-src yaml .PHONY: check_version pip-test-requirements pip-requirements clean_pyc -.PHONY: unittest style-check doc +.PHONY: unittest style-check doc fix_spelling check_spelling |